File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -573,15 +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) ||
582- (isa<SymbolOpInterface>(op) && !isa<FunctionOpInterface>(op)) ||
583581 (isa<SymbolUserOpInterface>(op) && !isa<CallOpInterface>(op))) {
584- op->emitError () << " cannot optimize an IR with non-function symbol ops, "
582+ op->emitError () << " cannot optimize an IR with "
585583 " non-call symbol user ops or branch ops\n " ;
586584 return WalkResult::interrupt ();
587585 }
Original file line number Diff line number Diff line change 11// RUN: mlir-opt %s -remove-dead-values -split-input-file -verify-diagnostics | FileCheck %s
22
3- // The IR remains untouched because of the presence of a non-function-like
4- // symbol op inside the module (const @__dont_touch_unacceptable_ir).
3+ // The IR is updated regardless of memref.global private constant
54//
65module {
7- // expected-error @+1 {{cannot optimize an IR with non-function symbol ops, non-call symbol user ops or branch ops}}
8- memref.global " private" constant @__dont_touch_unacceptable_ir : memref <i32 > = dense <0 >
6+ memref.global " private" constant @__something_global : memref <i32 > = dense <0 >
97 func.func @main (%arg0: i32 ) -> i32 {
8+ %0 = tensor.empty () : tensor <10 xbf16 >
9+ // CHECK-NOT: tensor.empty
1010 return %arg0 : i32
1111 }
1212}
@@ -29,7 +29,7 @@ module @named_module_acceptable {
2929//
3030func.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
You can’t perform that action at this time.
0 commit comments