[Mlir-commits] [mlir] [mlir][affine] fix the issue of celidiv mul ceildiv expression not satisfying commutative (PR #109382)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Oct 4 02:37:13 PDT 2024
================
@@ -349,6 +350,82 @@ unsigned AffineDimExpr::getPosition() const {
return static_cast<ImplType *>(expr)->position;
}
+/// A manually managed stack used to convert recursive function calls into
----------------
lipracer wrote:
Maybe I haven't understood what you mean yet. Firstly, we need to manually manage stack operations instead of recursive calls, because to fix this problem, we must be able to access the contents of the stack in a visible way. The callstack here is just a simple encapsulation of stack operations. Secondly, combining walk operations and putting the value of return into the stack can indeed achieve this function. However, we need to make corresponding changes to the original function isDivisibleBySymbol. I didn't use the walk method here to preserve the original code structure as much as possible, and the walk was implemented through the affineexpiewer or recursion. Since we used the stack here, it's best to avoid recursion.
https://github.com/llvm/llvm-project/pull/109382
More information about the Mlir-commits
mailing list