[Mlir-commits] [mlir] 532d484 - [mlir][Quasipolynomials] Fixed type issues in GeneratorFuunction.h (#76413)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Dec 26 14:34:36 PST 2023
Author: Balaji V. Iyer
Date: 2023-12-26T16:34:32-06:00
New Revision: 532d4845ed0afced7cb1f8c7a4e3499b63cc3de3
URL: https://github.com/llvm/llvm-project/commit/532d4845ed0afced7cb1f8c7a4e3499b63cc3de3
DIFF: https://github.com/llvm/llvm-project/commit/532d4845ed0afced7cb1f8c7a4e3499b63cc3de3.diff
LOG: [mlir][Quasipolynomials] Fixed type issues in GeneratorFuunction.h (#76413)
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.
Added:
Modified:
mlir/lib/Analysis/Presburger/GeneratingFunction.h
Removed:
################################################################################
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
diff erent 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
More information about the Mlir-commits
mailing list