Skip to content

Commit 478e0db

Browse files
committed
[FIRRTL] Fix pre-order walk in IMCP
IMCP needs to use a post-order walk as it is deleting operations (and the operations are not skipped after erasure). This should fix observed failures in nightly CI [[1]]. [1]: 46014cd#commitcomment-146717821 Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
1 parent f9ca6b0 commit 478e0db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Dialect/FIRRTL/Transforms/IMConstProp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ void IMConstPropPass::rewriteModuleBody(FModuleOp module) {
10161016
//
10171017
// TODO: Handle WhenOps correctly.
10181018
bool aboveCursor = false;
1019-
module.walk<mlir::WalkOrder::PreOrder, mlir::ReverseIterator>(
1019+
module.walk<mlir::WalkOrder::PostOrder, mlir::ReverseIterator>(
10201020
[&](Operation *op) {
10211021
auto dropIfDead = [&](Operation *op, const Twine &debugPrefix) {
10221022
if (op->use_empty() &&

0 commit comments

Comments
 (0)