File tree 2 files changed +7
-9
lines changed
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -573,15 +573,13 @@ void RemoveDeadValues::runOnOperation() {
573
573
Operation *module = getOperation ();
574
574
575
575
// 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.
578
577
WalkResult acceptableIR = module->walk ([&](Operation *op) {
579
578
if (op == module)
580
579
return WalkResult::advance ();
581
580
if (isa<BranchOpInterface>(op) ||
582
- (isa<SymbolOpInterface>(op) && !isa<FunctionOpInterface>(op)) ||
583
581
(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 "
585
583
" non-call symbol user ops or branch ops\n " ;
586
584
return WalkResult::interrupt ();
587
585
}
Original file line number Diff line number Diff line change 1
1
// RUN: mlir-opt %s -remove-dead-values -split-input-file -verify-diagnostics | FileCheck %s
2
2
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
5
4
//
6
5
module {
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 >
9
7
func.func @main (%arg0: i32 ) -> i32 {
8
+ %0 = tensor.empty () : tensor <10 xbf16 >
9
+ // CHECK-NOT: tensor.empty
10
10
return %arg0 : i32
11
11
}
12
12
}
@@ -29,7 +29,7 @@ module @named_module_acceptable {
29
29
//
30
30
func.func @dont_touch_unacceptable_ir_has_cleanable_simple_op_with_branch_op (%arg0: i1 ) {
31
31
%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}}
33
33
cf.cond_br %arg0 , ^bb1 (%non_live : i32 ), ^bb2 (%non_live : i32 )
34
34
^bb1 (%non_live_0 : i32 ):
35
35
cf.br ^bb3
You can’t perform that action at this time.
0 commit comments