================ @@ -5759,9 +5761,18 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, getCUDARuntime().internalizeDeviceSideVar(D, Linkage); } getCUDARuntime().handleVarRegistration(D, *GV); + } else if (LangOpts.HLSL && + GetGlobalVarAddressSpace(D) == LangAS::hlsl_input) { + // HLSL Input variables are considered to be set by the driver/pipeline, but + // only visible to a single thread/wave. + GV->setExternallyInitialized(true); ---------------- Keenuts wrote:
I initially did this, but I found it less clear: it was not clear reading the top level function what property was changed by sub-functions, and other languages did it at the top level, so it felt confusing. I prefer to only keep the metadata generation in the CGHLSLRuntime function. https://github.com/llvm/llvm-project/pull/138530 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits