Skip to content

Commit cbc9651

Browse files
committed
Address movement of config
1 parent 1255448 commit cbc9651

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mlir/lib/Transforms/Utils/DialectConversion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,6 +2259,7 @@ OperationLegalizer::legalize(Operation *op,
22592259

22602260
// If the operation is not legal, try to fold it in-place if the folding mode
22612261
// is 'BeforePatterns'. 'Never' will skip this.
2262+
const ConversionConfig &config = rewriter.getConfig();
22622263
if (config.foldingMode == DialectConversionFoldingMode::BeforePatterns) {
22632264
if (succeeded(legalizeWithFold(op, rewriter))) {
22642265
LLVM_DEBUG({

mlir/test/Transforms/test-legalizer-no-fold.mlir

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ func.func @remove_foldable_op(%arg0 : i32) -> (i32) {
88
"foo.op_with_region_terminator"() : () -> ()
99
}) : (i32) -> (i32)
1010
"test.return"(%0) : (i32) -> ()
11-
}
11+
}
12+

0 commit comments

Comments
 (0)