[llvm] [DirectX] Add GlobalDCE pass after finalize linkage pass in DirectX backend (PR #151071)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 14:18:07 PDT 2025


================
@@ -1,10 +1,17 @@
-; RUN: opt -S -dxil-finalize-linkage -mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s
+; RUN: opt -S -passes='dxil-finalize-linkage,globaldce' -mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s
----------------
bogner wrote:

I think it'd be better to have this pass explicitly check that the linkage was updated correctly rather than running globaldce in this run line.

If we want to test that the whole pipeline eliminates the right globals we could do that separately with an `llc` test.

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


More information about the llvm-commits mailing list