Skip to content

Commit c145899

Browse files
committed
Address feedback from Code Review
1 parent 0247d1b commit c145899

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

mlir/lib/Transforms/RemoveDeadValues.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,14 +573,13 @@ void RemoveDeadValues::runOnOperation() {
573573
Operation *module = getOperation();
574574

575575
// The removal of non-live values is performed iff there are no branch ops,
576-
// all symbol ops present in the IR are function-like, and all symbol user ops
577-
// present in the IR are call-like.
576+
// and all symbol user ops present in the IR are call-like.
578577
WalkResult acceptableIR = module->walk([&](Operation *op) {
579578
if (op == module)
580579
return WalkResult::advance();
581580
if (isa<BranchOpInterface>(op) ||
582581
(isa<SymbolUserOpInterface>(op) && !isa<CallOpInterface>(op))) {
583-
op->emitError() << "cannot optimize an IR with non-function symbol ops, "
582+
op->emitError() << "cannot optimize an IR with "
584583
"non-call symbol user ops or branch ops\n";
585584
return WalkResult::interrupt();
586585
}

mlir/test/Transforms/remove-dead-values.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// The IR is updated regardless of memref.global private constant
44
//
55
module {
6-
memref.global "private" constant @__dont_touch_unacceptable_ir : memref<i32> = dense<0>
6+
memref.global "private" constant @__something_global : memref<i32> = dense<0>
77
func.func @main(%arg0: i32) -> i32 {
88
%0 = tensor.empty() : tensor<10xbf16>
99
// CHECK-NOT: tensor.empty
@@ -29,7 +29,7 @@ module @named_module_acceptable {
2929
//
3030
func.func @dont_touch_unacceptable_ir_has_cleanable_simple_op_with_branch_op(%arg0: i1) {
3131
%non_live = arith.constant 0 : i32
32-
// expected-error @+1 {{cannot optimize an IR with non-function symbol ops, non-call symbol user ops or branch ops}}
32+
// expected-error @+1 {{cannot optimize an IR with non-call symbol user ops or branch ops}}
3333
cf.cond_br %arg0, ^bb1(%non_live : i32), ^bb2(%non_live : i32)
3434
^bb1(%non_live_0 : i32):
3535
cf.br ^bb3

0 commit comments

Comments
 (0)