diff --git a/mlir/lib/Transforms/RemoveDeadValues.cpp b/mlir/lib/Transforms/RemoveDeadValues.cpp index 7e45f18b660ba..9f94248571129 100644 --- a/mlir/lib/Transforms/RemoveDeadValues.cpp +++ b/mlir/lib/Transforms/RemoveDeadValues.cpp @@ -191,10 +191,10 @@ static void cleanSimpleOp(Operation *op, RunLivenessAnalysis &la) { /// non-live across all callers), /// (5) Dropping the uses of these return values from its callers, AND /// (6) Erasing these return values -/// iff it is not public or declaration. +/// iff it is not public or external. static void cleanFuncOp(FunctionOpInterface funcOp, Operation *module, RunLivenessAnalysis &la) { - if (funcOp.isPublic() || funcOp.isDeclaration()) + if (funcOp.isPublic() || funcOp.isExternal()) return; // Get the list of unnecessary (non-live) arguments in `nonLiveArgs`. diff --git a/mlir/test/Transforms/remove-dead-values.mlir b/mlir/test/Transforms/remove-dead-values.mlir index 9f2be3331b6b4..edb100acf3849 100644 --- a/mlir/test/Transforms/remove-dead-values.mlir +++ b/mlir/test/Transforms/remove-dead-values.mlir @@ -374,3 +374,8 @@ func.func @kernel(%arg0: memref<18xf32>) { // CHECK: func.func private @no_block_func_declaration() func.func private @no_block_func_declaration() -> () + +// ----- + +// CHECK: llvm.func @no_block_external_func() +llvm.func @no_block_external_func() attributes {sym_visibility = "private"}