Before this change, we would run maxIterations if the first iteration changed the op.
After this change, we exit the loop as soon as an iteration hasn't changed the op.
Assuming that we have reached a fixed point when an iteration doesn't change the op, this doesn't affect correctness.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Can you add a line or two to the description for context on the fix? This just helps reach a fixed point faster and shouldn't affect correctness at all.
Thanks for the fix!
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp | ||
---|---|---|
302 | Can you keep the initialization here anyways? It's a nice to sanity check to always have variables initialized to a good default. |
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp | ||
---|---|---|
302 | I've heard the opposite advice -- you should leave variables uninitialized when they're not expected to be used, that way asan will let you know if your assumption is violated. In this trivial case it doesn't matter though. |
Can you keep the initialization here anyways? It's a nice to sanity check to always have variables initialized to a good default.