Skip to content

[mlir][Quasipolynomials] Fixed type issues in GeneratorFunction.h #76413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

bviyer
Copy link
Contributor

@bviyer bviyer commented Dec 26, 2023

Fixed two issues: A SmallVector size that caused size-differences issue (8 vs. 12). Thus removed this size restriction. Also a constant parameter was causing an issue in a function not marked constant.

Fixed two issues: A SmallVector size that caused size-differences issue
(8 vs. 12). Thus removed this size restriction. Also a constant parameter
was causing an issue in a function not marked constant.
@llvmbot
Copy link
Member

llvmbot commented Dec 26, 2023

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-presburger

Author: Balaji V. Iyer. (bviyer)

Changes

Fixed two issues: A SmallVector size that caused size-differences issue (8 vs. 12). Thus removed this size restriction. Also a constant parameter was causing an issue in a function not marked constant.


Full diff: https://github.com/llvm/llvm-project/pull/76413.diff

1 Files Affected:

  • (modified) mlir/lib/Analysis/Presburger/GeneratingFunction.h (+5-5)
diff --git a/mlir/lib/Analysis/Presburger/GeneratingFunction.h b/mlir/lib/Analysis/Presburger/GeneratingFunction.h
index 8676b84c1c4df8..dad9594f960d1b 100644
--- a/mlir/lib/Analysis/Presburger/GeneratingFunction.h
+++ b/mlir/lib/Analysis/Presburger/GeneratingFunction.h
@@ -49,7 +49,7 @@ using Point = SmallVector<Fraction>;
 // g_{ij} \in Q^n are vectors.
 class GeneratingFunction {
 public:
-  GeneratingFunction(unsigned numParam, SmallVector<int, 8> signs,
+  GeneratingFunction(unsigned numParam, SmallVector<int> signs,
                      std::vector<ParamPoint> nums,
                      std::vector<std::vector<Point>> dens)
       : numParam(numParam), signs(signs), numerators(nums), denominators(dens) {
@@ -67,7 +67,7 @@ class GeneratingFunction {
 
   std::vector<std::vector<Point>> getDenominators() { return denominators; }
 
-  GeneratingFunction operator+(const GeneratingFunction &gf) const {
+  GeneratingFunction operator+(GeneratingFunction &gf) const {
     assert(numParam == gf.getNumParams() &&
            "two generating functions with different numbers of parameters "
            "cannot be added!");
@@ -81,7 +81,7 @@ class GeneratingFunction {
     std::vector<std::vector<Point>> sumDenominators = denominators;
     sumDenominators.insert(sumDenominators.end(), gf.denominators.begin(),
                            gf.denominators.end());
-    return GeneratingFunction(sumSigns, sumNumerators, sumDenominators);
+    return GeneratingFunction(0, sumSigns, sumNumerators, sumDenominators);
   }
 
   llvm::raw_ostream &print(llvm::raw_ostream &os) const {
@@ -121,7 +121,7 @@ class GeneratingFunction {
 
 private:
   unsigned numParam;
-  SmallVector<int, 8> signs;
+  SmallVector<int> signs;
   std::vector<ParamPoint> numerators;
   std::vector<std::vector<Point>> denominators;
 };
@@ -129,4 +129,4 @@ class GeneratingFunction {
 } // namespace presburger
 } // namespace mlir
 
-#endif // MLIR_ANALYSIS_PRESBURGER_GENERATINGFUNCTION_H
\ No newline at end of file
+#endif // MLIR_ANALYSIS_PRESBURGER_GENERATINGFUNCTION_H

Copy link
Contributor

@olegshyshkov olegshyshkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the typo in the commit description.

@bviyer bviyer merged commit 532d484 into llvm:main Dec 26, 2023
@bviyer bviyer changed the title [mlir][Quasipolynomials] Fixed type issues in GeneratorFuunction.h [mlir][Quasipolynomials] Fixed type issues in GeneratorFunction.h Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants