Skip to content

Commit e02704b

Browse files
committed
Revert "[SPIRV] Allow multiple FuncParamAttr decoration on the same id. (#166782)"
This reverts commit 2681497. (This is being reverted because this commit needs ebcf025, which was previously reverted.)
1 parent 1b105a1 commit e02704b

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,17 @@ static InstrSignature instrToSignature(const MachineInstr &MI,
251251
<<<<<<< HEAD
252252
=======
253253
// The only decorations that can be applied more than once to a given <id>
254-
// or structure member are FuncParamAttr (38), UserSemantic (5635),
255-
// CacheControlLoadINTEL (6442), and CacheControlStoreINTEL (6443). For all
256-
// the rest of decorations, we will only add to the signature the Opcode,
257-
// the id to which it applies, and the decoration id, disregarding any
258-
// decoration flags. This will ensure that any subsequent decoration with
259-
// the same id will be deemed as a duplicate. Then, at the call site, we
260-
// will be able to handle duplicates in the best way.
254+
// or structure member are UserSemantic(5635), CacheControlLoadINTEL (6442),
255+
// and CacheControlStoreINTEL (6443). For all the rest of decorations, we
256+
// will only add to the signature the Opcode, the id to which it applies,
257+
// and the decoration id, disregarding any decoration flags. This will
258+
// ensure that any subsequent decoration with the same id will be deemed as
259+
// a duplicate. Then, at the call site, we will be able to handle duplicates
260+
// in the best way.
261261
unsigned Opcode = MI.getOpcode();
262262
if ((Opcode == SPIRV::OpDecorate) && i >= 2) {
263263
unsigned DecorationID = MI.getOperand(1).getImm();
264-
if (DecorationID != SPIRV::Decoration::FuncParamAttr &&
265-
DecorationID != SPIRV::Decoration::UserSemantic &&
264+
if (DecorationID != SPIRV::Decoration::UserSemantic &&
266265
DecorationID != SPIRV::Decoration::CacheControlLoadINTEL &&
267266
DecorationID != SPIRV::Decoration::CacheControlStoreINTEL)
268267
continue;

llvm/test/CodeGen/SPIRV/spirv_param_decorations_quals.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ entry:
77

88
; CHECK-SPIRV: OpDecorate %[[#PId:]] Volatile
99
; CHECK-SPIRV: OpDecorate %[[#PId]] FuncParamAttr NoAlias
10-
; CHECK-SPIRV: OpDecorate %[[#PId]] FuncParamAttr NoWrite
1110
; CHECK-SPIRV: %[[#PId]] = OpFunctionParameter %[[#]]
1211

1312
!7 = !{!"volatile"}
1413
!8 = !{i32 38, i32 4} ; FuncParamAttr NoAlias
15-
!11 = !{i32 38, i32 6} ; FuncParamAttr NoWrite
16-
!9 = !{!8, !11}
14+
!9 = !{!8}
1715
!10 = !{!9}

0 commit comments

Comments
 (0)