[llvm] [DirectX] Legalize `llvm.lifetime.*` intrinsics in EmbedDXILPass (PR #150100)

Deric C. via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 22 14:49:40 PDT 2025


================
@@ -70,8 +116,17 @@ class EmbedDXILPass : public llvm::ModulePass {
     // Only the output bitcode need to be DXIL triple.
     M.setTargetTriple(Triple("dxil-ms-dx"));
 
+    // Perform late legalization of lifetime intrinsics that would otherwise
+    // fail the Module Verifier if performed in an earlier pass
+    legalizeLifetimeIntrinsics(M);
+
     WriteDXILToFile(M, OS);
 
+    // We no longer need lifetime intrinsics after bitcode serialization, so we
+    // simply remove them to keep the Module Verifier happy after our
+    // not-so-legal legalizations
----------------
Icohedron wrote:

It's only the lifetime intrinsic function declaration that is removed, no?

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


More information about the llvm-commits mailing list