[clang] [llvm] [DirectX] Remove trivially dead functions at linkage finalize (PR #106146)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 14:29:27 PDT 2024


================
@@ -0,0 +1,80 @@
+; RUN: opt -S -dxil-finalize-linkage -mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s
+; RUN: llc %s --filetype=asm -o - | FileCheck %s
+
+target triple = "dxilv1.5-pc-shadermodel6.5-compute"
+
+; Confirm that DXILFinalizeLinkage will remove functions that have compatible
+; linkage and are not called from anywhere. This should be any function that
+; is not explicitly marked noinline or export and is not an entry point.
+
+; Not called nor marked with any linking or inlining attributes.
+; CHECK-NOT: define {{.*}}doNothingNothing
----------------
hekota wrote:

Maybe add 'should be removed' to be consistent with all the other comments.

https://github.com/llvm/llvm-project/pull/106146


More information about the cfe-commits mailing list