[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

Nathan Gauër via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 08:51:25 PDT 2025


================
@@ -5636,6 +5636,8 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D,
     Init = llvm::UndefValue::get(getTypes().ConvertTypeForMem(ASTTy));
   else if (D->hasAttr<LoaderUninitializedAttr>())
     Init = llvm::UndefValue::get(getTypes().ConvertTypeForMem(ASTTy));
+  else if (GetGlobalVarAddressSpace(D) == LangAS::hlsl_input)
+    Init = llvm::UndefValue::get(getTypes().ConvertTypeForMem(ASTTy));
----------------
Keenuts wrote:

I don't think we want `poison`: the value will be set by something outside.
Maybe I should change the condition below which calls `setInitializer` so we don't add any poison/undef.

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


More information about the cfe-commits mailing list