Skip to content

Commit 0f400cb

Browse files
[SPIR-V] Don't add linkage attributes for input variables (#132301)
Fixes #131878
1 parent 5ecbf46 commit 0f400cb

File tree

4 files changed

+2
-5
lines changed

4 files changed

+2
-5
lines changed

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3993,7 +3993,7 @@ bool SPIRVInstructionSelector::loadVec3BuiltinInputID(
39933993
// builtin variable.
39943994
Register Variable = GR.buildGlobalVariable(
39953995
NewRegister, PtrType, getLinkStringForBuiltIn(BuiltInValue), nullptr,
3996-
SPIRV::StorageClass::Input, nullptr, true, true,
3996+
SPIRV::StorageClass::Input, nullptr, true, false,
39973997
SPIRV::LinkageType::Import, MIRBuilder, false);
39983998

39993999
// Create new register for loading value.
@@ -4046,7 +4046,7 @@ bool SPIRVInstructionSelector::loadBuiltinInputID(
40464046
// builtin variable.
40474047
Register Variable = GR.buildGlobalVariable(
40484048
NewRegister, PtrType, getLinkStringForBuiltIn(BuiltInValue), nullptr,
4049-
SPIRV::StorageClass::Input, nullptr, true, true,
4049+
SPIRV::StorageClass::Input, nullptr, true, false,
40504050
SPIRV::LinkageType::Import, MIRBuilder, false);
40514051

40524052
// Load uint value from the global variable.

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/SV_DispatchThreadID.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
; CHECK-DAG: OpEntryPoint GLCompute {{.*}} %[[#GlobalInvocationId]]
1818
; CHECK-DAG: OpName %[[#GlobalInvocationId]] "__spirv_BuiltInGlobalInvocationId"
19-
; CHECK-DAG: OpDecorate %[[#GlobalInvocationId]] LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
2019
; CHECK-DAG: OpDecorate %[[#GlobalInvocationId]] BuiltIn GlobalInvocationId
2120

2221
; ModuleID = '-'

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/SV_GroupID.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
; CHECK-DAG: OpEntryPoint GLCompute {{.*}} %[[#WorkgroupId]]
1111
; CHECK-DAG: OpName %[[#WorkgroupId]] "__spirv_BuiltInWorkgroupId"
12-
; CHECK-DAG: OpDecorate %[[#WorkgroupId]] LinkageAttributes "__spirv_BuiltInWorkgroupId" Import
1312
; CHECK-DAG: OpDecorate %[[#WorkgroupId]] BuiltIn WorkgroupId
1413

1514
target triple = "spirv-unknown-vulkan-library"

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/SV_GroupThreadID.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
; CHECK-DAG: OpEntryPoint GLCompute {{.*}} %[[#LocalInvocationId]]
1818
; CHECK-DAG: OpName %[[#LocalInvocationId]] "__spirv_BuiltInLocalInvocationId"
19-
; CHECK-DAG: OpDecorate %[[#LocalInvocationId]] LinkageAttributes "__spirv_BuiltInLocalInvocationId" Import
2019
; CHECK-DAG: OpDecorate %[[#LocalInvocationId]] BuiltIn LocalInvocationId
2120

2221
; ModuleID = '-'

0 commit comments

Comments
 (0)