Set visibility of outlined function as private during ClusterOutliningPass.
PiperOrigin-RevId: 305691287 Change-Id: Ib53ed2aaacdb6b95a8e2b5a5013b413931913adb
This commit is contained in:
parent
15c0cb71fe
commit
fbac644835
@ -27,6 +27,7 @@ module {
|
||||
|
||||
// CHECK-LABEL: func @tpu0_func
|
||||
// CHECK-SAME: (%[[TPU0_FUNC_ARG_0:[a-z0-9]*]]: tensor<?xi32>) -> tensor<?xi32>
|
||||
// CHECK-SAME: sym_visibility = "private"
|
||||
// CHECK: %[[TPU0_FUNC_B_OUTPUT:[0-9]*]] = "tf.B"(%[[TPU0_FUNC_ARG_0]])
|
||||
// CHECK: return %[[TPU0_FUNC_B_OUTPUT]]
|
||||
}
|
||||
|
@ -66,6 +66,10 @@ FuncOp BuildFunction(StringRef device, llvm::ArrayRef<Value> live_ins,
|
||||
FuncOp outlined_func =
|
||||
FuncOp::create(launch_op.getLoc(), func_name_prefix, func_type);
|
||||
|
||||
// This function is not externally visible and marking it private would allow
|
||||
// symbol-dce pass to remove it when it is not referenced anymore.
|
||||
outlined_func.setVisibility(FuncOp::Visibility::Private);
|
||||
|
||||
// Create function body.
|
||||
Block* outlined_func_block = outlined_func.addEntryBlock();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user