[clang] [llvm] [HLSL][Clang] Start emitting @llvm.structured.alloca (PR #190157)

Nathan Gauër via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 05:15:26 PDT 2026


================
@@ -986,7 +989,11 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD,
       if (!SemanticValue)
         return;
       if (Param.hasByValAttr()) {
-        llvm::Value *Var = B.CreateAlloca(Param.getParamByValType());
+        llvm::Value *Var =
+            CGM.getLangOpts().EmitLogicalPointer
----------------
Keenuts wrote:

IRBuilder has no info about the codegen context. Doing this would require modifying the way we create it to pass either CGM or LangOpt, or something else.
Alternative is to add an optional bool "structured" in the CreateAlloca, but it's almost the same.

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


More information about the cfe-commits mailing list