Added a simple normalize function to divisionrepr and added a simple unittest.
Added a normalizediv call to divisionrepr's removeDuplicateDivs function, which now eliminates divs that are consistent after gcd's normalize
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thank you for the patch! I added some comments to get started.
mlir/include/mlir/Analysis/Presburger/Utils.h | ||
---|---|---|
159 | Please add documentation for this method. | |
mlir/lib/Analysis/Presburger/Utils.cpp | ||
434 | I don't think this solves this TODO. That is a separate issue. That TODO refers to cases when divisionA = divisionB + constant. I would not delete that TODO. | |
477 | I prefer writing this loop like this: for (unsigned i = 0, e = getNumDivs(); i < e; ++i) That is the preferred method of writing loops when the end condition does not change throughout the loop | |
478 | There is no need to put braces for this if condition: https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements | |
483 | You can drop the return here. | |
mlir/unittests/Analysis/Presburger/CMakeLists.txt | ||
13 | I would name this file UtilsTest.cpp maybe. |
mlir/include/mlir/Analysis/Presburger/Utils.h | ||
---|---|---|
160 | I don't think you need to mention "other than 1". That just makes it confusing. |
Please add documentation for this method.