This revision fixes a bug where an operation would get replaced with
a pre-existing constant that didn't dominate it. This can occur when
a pattern inserts operations to be folded at the beginning of the
constants insertion block. This revision fixes the bug by moving the
existing constant before the replaced operation in such cases. This is
fine because if a constant didn't already exist, a new one would have
been inserted before this operation anyways.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Nice catch and fix!
constant before the replaced operation in such cases, something
that would happen anyways if the constant didn't already exist.
This clause isn't clear to me. Is there a typo?
mlir/lib/Transforms/Utils/FoldUtils.cpp | ||
---|---|---|
237 | This may happen -> This may not automatically happen ... or a slight rephrasing? | |
mlir/test/lib/Dialect/Test/TestPatterns.cpp | ||
102 | Short comment here. |
Comment Actions
FYI, this bug introduced a major performance regression in canonicalize:
https://bugs.llvm.org/show_bug.cgi?id=51738
-Chris
This may happen -> This may not automatically happen ... or a slight rephrasing?