Skip to content

Commit a53e0ef

Browse files
NikitaRudenkoInteligcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 23f4da1
Update SPIRVDLL patches
1 parent 1fa2ca2 commit a53e0ef

File tree

28 files changed

+661
-358
lines changed

28 files changed

+661
-358
lines changed

IGC/VectorCompiler/cmake/spirv.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,17 @@ else()
157157
message(FATAL_ERROR "[VC] Cannot find LLVM version (LLVM_VERSION_MAJOR)")
158158
elseif(${LLVM_VERSION_MAJOR} EQUAL 9)
159159
message(STATUS "[VC] Found LLVM version 9")
160-
set(SPIRV_REV_PATCH 13bdd947cec56dc37a1dce6399c3f1315a143127)
160+
set(SPIRV_REV_PATCH 4aafd4768e4fea7b6e7481d07bc31aefc1c7bacc)
161161
set(SPRIV_PATCHES ${CMAKE_CURRENT_SOURCE_DIR}/spirv-patches-9/)
162162
set(SPRIV_BRANCH_PATCH spirvdll_90)
163163
elseif(${LLVM_VERSION_MAJOR} EQUAL 10)
164164
message(STATUS "[VC] Found LLVM version 10")
165-
set(SPIRV_REV_PATCH 0054933aac6614ca8a70c13ce86e4dd9de169373)
165+
set(SPIRV_REV_PATCH 4f1a3270f2431aa98f1bff30d1a32c9d8f4729bf)
166166
set(SPRIV_PATCHES ${CMAKE_CURRENT_SOURCE_DIR}/spirv-patches-10/)
167167
set(SPRIV_BRANCH_PATCH spirvdll_100)
168168
elseif(${LLVM_VERSION_MAJOR} EQUAL 11)
169169
message(STATUS "[VC] Found LLVM version 11")
170-
set(SPIRV_REV_PATCH 9ded20cc5d1ec77f35ba5cce610bbe28b2070a6d)
170+
set(SPIRV_REV_PATCH 73dfc6d450ad0438558bee20505c426319f7624b)
171171
set(SPRIV_PATCHES ${CMAKE_CURRENT_SOURCE_DIR}/spirv-patches-11/)
172172
set(SPRIV_BRANCH_PATCH spirvdll_110)
173173
else()
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: nrudenko <[email protected]>
3+
Date: Thu, 4 Jun 2020 16:34:15 +0300
4+
Subject: [PATCH 1/6] Add DecorationFuncParamKindINTEL and
5+
DecorationFuncParamDescINTEL
6+
7+
---
8+
lib/SPIRV/SPIRVReader.cpp | 12 ++++++++++++
9+
lib/SPIRV/SPIRVWriter.cpp | 13 +++++++++++++
10+
lib/SPIRV/VectorComputeUtil.h | 2 ++
11+
lib/SPIRV/libSPIRV/SPIRVDecorate.cpp | 12 ++++++++++++
12+
lib/SPIRV/libSPIRV/SPIRVDecorate.h | 9 +++++++++
13+
lib/SPIRV/libSPIRV/SPIRVEnum.h | 2 ++
14+
lib/SPIRV/libSPIRV/SPIRVIsValidEnum.h | 2 ++
15+
lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h | 2 ++
16+
lib/SPIRV/libSPIRV/spirv.hpp | 2 ++
17+
9 files changed, 56 insertions(+)
18+
19+
diff --git a/lib/SPIRV/SPIRVReader.cpp b/lib/SPIRV/SPIRVReader.cpp
20+
index 0000000..0000000 100644
21+
--- a/lib/SPIRV/SPIRVReader.cpp
22+
+++ b/lib/SPIRV/SPIRVReader.cpp
23+
@@ -3384,6 +3384,18 @@ bool SPIRVToLLVM::transVectorComputeMetadata(SPIRVFunction *BF) {
24+
std::to_string(Kind));
25+
F->addAttribute(ArgNo + 1, Attr);
26+
}
27+
+ if (BA->hasDecorate(DecorationFuncParamKindINTEL, 0, &Kind)) {
28+
+ Attribute Attr = Attribute::get(*Context, kVCMetadata::VCArgumentKind,
29+
+ std::to_string(Kind));
30+
+ F->addAttribute(ArgNo + 1, Attr);
31+
+ }
32+
+ if (BA->hasDecorate(DecorationFuncParamDescINTEL)) {
33+
+ auto Desc =
34+
+ BA->getDecorationStringLiteral(DecorationFuncParamDescINTEL).front();
35+
+ Attribute Attr =
36+
+ Attribute::get(*Context, kVCMetadata::VCArgumentDesc, Desc);
37+
+ F->addAttribute(ArgNo + 1, Attr);
38+
+ }
39+
}
40+
41+
// Do not add float control if there is no any
42+
diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp
43+
index 0000000..0000000 100644
44+
--- a/lib/SPIRV/SPIRVWriter.cpp
45+
+++ b/lib/SPIRV/SPIRVWriter.cpp
46+
@@ -579,6 +579,19 @@ void LLVMToSPIRV::transVectorComputeMetadata(Function *F) {
47+
.getAsInteger(0, Kind);
48+
BA->addDecorate(DecorationFuncParamIOKind, Kind);
49+
}
50+
+ if (Attrs.hasAttribute(ArgNo + 1, kVCMetadata::VCArgumentKind)) {
51+
+ SPIRVWord Kind;
52+
+ Attrs.getAttribute(ArgNo + 1, kVCMetadata::VCArgumentKind)
53+
+ .getValueAsString()
54+
+ .getAsInteger(0, Kind);
55+
+ BA->addDecorate(DecorationFuncParamKindINTEL, Kind);
56+
+ }
57+
+ if (Attrs.hasAttribute(ArgNo + 1, kVCMetadata::VCArgumentDesc)) {
58+
+ StringRef Desc =
59+
+ Attrs.getAttribute(ArgNo + 1, kVCMetadata::VCArgumentDesc)
60+
+ .getValueAsString();
61+
+ BA->addDecorate(new SPIRVDecorateFuncParamDescAttr(BA, Desc.str()));
62+
+ }
63+
}
64+
if (!isKernel(F) &&
65+
BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_float_controls2) &&
66+
diff --git a/lib/SPIRV/VectorComputeUtil.h b/lib/SPIRV/VectorComputeUtil.h
67+
index 0000000..0000000 100755
68+
--- a/lib/SPIRV/VectorComputeUtil.h
69+
+++ b/lib/SPIRV/VectorComputeUtil.h
70+
@@ -108,6 +108,8 @@ const static char VCGlobalVariable[] = "VCGlobalVariable";
71+
const static char VCVolatile[] = "VCVolatile";
72+
const static char VCByteOffset[] = "VCByteOffset";
73+
const static char VCSIMTCall[] = "VCSIMTCall";
74+
+const static char VCArgumentKind[] = "VCArgumentKind";
75+
+const static char VCArgumentDesc[] = "VCArgumentDesc";
76+
} // namespace kVCMetadata
77+
78+
namespace kVCType {
79+
diff --git a/lib/SPIRV/libSPIRV/SPIRVDecorate.cpp b/lib/SPIRV/libSPIRV/SPIRVDecorate.cpp
80+
index 0000000..0000000 100644
81+
--- a/lib/SPIRV/libSPIRV/SPIRVDecorate.cpp
82+
+++ b/lib/SPIRV/libSPIRV/SPIRVDecorate.cpp
83+
@@ -113,6 +113,9 @@ void SPIRVDecorate::encode(spv_ostream &O) const {
84+
case DecorationUserSemantic:
85+
SPIRVDecorateUserSemanticAttr::encodeLiterals(Encoder, Literals);
86+
break;
87+
+ case DecorationFuncParamDescINTEL:
88+
+ SPIRVDecorateFuncParamDescAttr::encodeLiterals(Encoder, Literals);
89+
+ break;
90+
default:
91+
Encoder << Literals;
92+
}
93+
@@ -139,6 +142,9 @@ void SPIRVDecorate::decode(std::istream &I) {
94+
case DecorationUserSemantic:
95+
SPIRVDecorateUserSemanticAttr::decodeLiterals(Decoder, Literals);
96+
break;
97+
+ case DecorationFuncParamDescINTEL:
98+
+ SPIRVDecorateFuncParamDescAttr::decodeLiterals(Decoder, Literals);
99+
+ break;
100+
default:
101+
Decoder >> Literals;
102+
}
103+
@@ -158,6 +164,9 @@ void SPIRVMemberDecorate::encode(spv_ostream &O) const {
104+
case DecorationUserSemantic:
105+
SPIRVDecorateUserSemanticAttr::encodeLiterals(Encoder, Literals);
106+
break;
107+
+ case DecorationFuncParamDescINTEL:
108+
+ SPIRVDecorateFuncParamDescAttr::encodeLiterals(Encoder, Literals);
109+
+ break;
110+
default:
111+
Encoder << Literals;
112+
}
113+
@@ -181,6 +190,9 @@ void SPIRVMemberDecorate::decode(std::istream &I) {
114+
case DecorationUserSemantic:
115+
SPIRVDecorateUserSemanticAttr::decodeLiterals(Decoder, Literals);
116+
break;
117+
+ case DecorationFuncParamDescINTEL:
118+
+ SPIRVDecorateFuncParamDescAttr::decodeLiterals(Decoder, Literals);
119+
+ break;
120+
default:
121+
Decoder >> Literals;
122+
}
123+
diff --git a/lib/SPIRV/libSPIRV/SPIRVDecorate.h b/lib/SPIRV/libSPIRV/SPIRVDecorate.h
124+
index 0000000..0000000 100644
125+
--- a/lib/SPIRV/libSPIRV/SPIRVDecorate.h
126+
+++ b/lib/SPIRV/libSPIRV/SPIRVDecorate.h
127+
@@ -418,6 +418,15 @@ public:
128+
: SPIRVDecorateStrAttrBase(TheTarget, AnnotateString) {}
129+
};
130+
131+
+class SPIRVDecorateFuncParamDescAttr
132+
+ : public SPIRVDecorateStrAttrBase<DecorationFuncParamDescINTEL> {
133+
+public:
134+
+ // Complete constructor for UserSemantic decoration
135+
+ SPIRVDecorateFuncParamDescAttr(SPIRVEntry *TheTarget,
136+
+ const std::string &AnnotateString)
137+
+ : SPIRVDecorateStrAttrBase(TheTarget, AnnotateString) {}
138+
+};
139+
+
140+
class SPIRVDecorateMergeINTELAttr : public SPIRVDecorate {
141+
public:
142+
// Complete constructor for MergeINTEL decoration
143+
diff --git a/lib/SPIRV/libSPIRV/SPIRVEnum.h b/lib/SPIRV/libSPIRV/SPIRVEnum.h
144+
index 0000000..0000000 100644
145+
--- a/lib/SPIRV/libSPIRV/SPIRVEnum.h
146+
+++ b/lib/SPIRV/libSPIRV/SPIRVEnum.h
147+
@@ -401,6 +401,8 @@ template <> inline void SPIRVMap<Decoration, SPIRVCapVec>::init() {
148+
{CapabilityFunctionFloatControlINTEL});
149+
ADD_VEC_INIT(DecorationFunctionFloatingPointModeINTEL,
150+
{CapabilityFunctionFloatControlINTEL});
151+
+ ADD_VEC_INIT(DecorationFuncParamKindINTEL, {CapabilityVectorComputeINTEL});
152+
+ ADD_VEC_INIT(DecorationFuncParamDescINTEL, {CapabilityVectorComputeINTEL});
153+
}
154+
155+
template <> inline void SPIRVMap<BuiltIn, SPIRVCapVec>::init() {
156+
diff --git a/lib/SPIRV/libSPIRV/SPIRVIsValidEnum.h b/lib/SPIRV/libSPIRV/SPIRVIsValidEnum.h
157+
index 0000000..0000000 100644
158+
--- a/lib/SPIRV/libSPIRV/SPIRVIsValidEnum.h
159+
+++ b/lib/SPIRV/libSPIRV/SPIRVIsValidEnum.h
160+
@@ -422,6 +422,8 @@ inline bool isValid(spv::Decoration V) {
161+
case DecorationReferencedIndirectlyINTEL:
162+
case DecorationVectorComputeFunctionINTEL:
163+
case DecorationStackCallINTEL:
164+
+ case DecorationFuncParamKindINTEL:
165+
+ case DecorationFuncParamDescINTEL:
166+
case DecorationVectorComputeVariableINTEL:
167+
case DecorationGlobalVariableOffsetINTEL:
168+
case DecorationFuncParamIOKind:
169+
diff --git a/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h b/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
170+
index 0000000..0000000 100644
171+
--- a/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
172+
+++ b/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
173+
@@ -361,6 +361,8 @@ template <> inline void SPIRVMap<Decoration, std::string>::init() {
174+
add(DecorationReferencedIndirectlyINTEL, "ReferencedIndirectlyINTEL");
175+
add(DecorationVectorComputeFunctionINTEL, "VectorComputeFunctionINTEL");
176+
add(DecorationStackCallINTEL, "StackCallINTEL");
177+
+ add(DecorationFuncParamKindINTEL, "FuncParamKindINTEL");
178+
+ add(DecorationFuncParamDescINTEL, "FuncParamDescINTEL");
179+
add(DecorationVectorComputeVariableINTEL, "VectorComputeVariableINTEL");
180+
add(DecorationGlobalVariableOffsetINTEL, "GlobalVariableOffsetINTEL");
181+
add(DecorationFuncParamIOKind, "FuncParamIOKind");
182+
diff --git a/lib/SPIRV/libSPIRV/spirv.hpp b/lib/SPIRV/libSPIRV/spirv.hpp
183+
index 0000000..0000000 100644
184+
--- a/lib/SPIRV/libSPIRV/spirv.hpp
185+
+++ b/lib/SPIRV/libSPIRV/spirv.hpp
186+
@@ -486,6 +486,8 @@ enum Decoration {
187+
DecorationAliasedPointer = 5356,
188+
DecorationAliasedPointerEXT = 5356,
189+
DecorationSIMTCallINTEL = 5599,
190+
+ DecorationFuncParamKindINTEL = 9624,
191+
+ DecorationFuncParamDescINTEL = 9625,
192+
DecorationReferencedIndirectlyINTEL = 5602,
193+
DecorationSideEffectsINTEL = 5608,
194+
DecorationVectorComputeVariableINTEL = 5624,
195+
--
196+
2.17.1
197+

IGC/VectorCompiler/spirv-patches-10/0001-Add-SPIRVDLL-and-VCExport.patch renamed to IGC/VectorCompiler/spirv-patches-10/0002-Add-SPIRVDLL-and-VCExport.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: nrudenko <[email protected]>
33
Date: Thu, 4 Jun 2020 15:20:43 +0300
4-
Subject: [PATCH 1/8] Add SPIRVDLL and VCExport
4+
Subject: [PATCH 2/6] Add SPIRVDLL and VCExport
55

66
---
77
lib/SPIRV/CMakeLists.txt | 41 +++++++++++++++++-
@@ -15,7 +15,7 @@ Subject: [PATCH 1/8] Add SPIRVDLL and VCExport
1515
diff --git a/lib/SPIRV/CMakeLists.txt b/lib/SPIRV/CMakeLists.txt
1616
old mode 100644
1717
new mode 100755
18-
index 00000000..00000000
18+
index 0000000..0000000
1919
--- a/lib/SPIRV/CMakeLists.txt
2020
+++ b/lib/SPIRV/CMakeLists.txt
2121
@@ -1,4 +1,5 @@
@@ -83,7 +83,7 @@ index 00000000..00000000
8383
+)
8484
diff --git a/lib/SPIRV/VCExport.cpp b/lib/SPIRV/VCExport.cpp
8585
new file mode 100755
86-
index 00000000..00000000
86+
index 0000000..0000000
8787
--- /dev/null
8888
+++ b/lib/SPIRV/VCExport.cpp
8989
@@ -0,0 +1,89 @@
@@ -178,7 +178,7 @@ index 00000000..00000000
178178
+}
179179
diff --git a/lib/SPIRV/VCExport.h b/lib/SPIRV/VCExport.h
180180
new file mode 100755
181-
index 00000000..00000000
181+
index 0000000..0000000
182182
--- /dev/null
183183
+++ b/lib/SPIRV/VCExport.h
184184
@@ -0,0 +1,28 @@
@@ -211,5 +211,5 @@ index 00000000..00000000
211211
+
212212
+#endif // SPIRV_VCEXPORT_H
213213
--
214-
2.31.0
214+
2.17.1
215215

IGC/VectorCompiler/spirv-patches-10/0003-Add-BSymbolic-flag-to-libSPIRVDLL.so.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: nrudenko <[email protected]>
33
Date: Thu, 11 Jun 2020 15:58:34 +0300
4-
Subject: [PATCH 2/8] Remove LLVMSPIRVLib from targets Rename tool llvm-spirv
4+
Subject: [PATCH 3/6] Remove LLVMSPIRVLib from targets Rename tool llvm-spirv
55
to llvm-spirv-vc
66

77
---
@@ -11,7 +11,7 @@ Subject: [PATCH 2/8] Remove LLVMSPIRVLib from targets Rename tool llvm-spirv
1111
3 files changed, 2 insertions(+), 39 deletions(-)
1212

1313
diff --git a/lib/SPIRV/CMakeLists.txt b/lib/SPIRV/CMakeLists.txt
14-
index 00000000..00000000 100755
14+
index 0000000..0000000 100755
1515
--- a/lib/SPIRV/CMakeLists.txt
1616
+++ b/lib/SPIRV/CMakeLists.txt
1717
@@ -37,18 +37,6 @@ set(SPIRV_SOURCES
@@ -50,7 +50,7 @@ index 00000000..00000000 100755
5050
PRIVATE
5151
${LLVM_INCLUDE_DIRS}
5252
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
53-
index 00000000..00000000 100644
53+
index 0000000..0000000 100644
5454
--- a/test/CMakeLists.txt
5555
+++ b/test/CMakeLists.txt
5656
@@ -66,14 +66,6 @@ if(NOT LLVM_SPIRV_BUILD_EXTERNAL)
@@ -79,7 +79,7 @@ index 00000000..00000000 100644
7979
cmake_policy(POP)
8080
endif(LLVM_SPIRV_BUILD_EXTERNAL)
8181
diff --git a/tools/llvm-spirv/CMakeLists.txt b/tools/llvm-spirv/CMakeLists.txt
82-
index 00000000..00000000 100644
82+
index 0000000..0000000 100644
8383
--- a/tools/llvm-spirv/CMakeLists.txt
8484
+++ b/tools/llvm-spirv/CMakeLists.txt
8585
@@ -8,17 +8,13 @@ set(LLVM_LINK_COMPONENTS
@@ -103,5 +103,5 @@ index 00000000..00000000 100644
103103
${LLVM_INCLUDE_DIRS}
104104
${LLVM_SPIRV_INCLUDE_DIRS}
105105
--
106-
2.31.0
106+
2.17.1
107107

IGC/VectorCompiler/spirv-patches-10/0004-Add-pdb-info-for-SPIRVDLL-in-release-mode.patch

Lines changed: 0 additions & 39 deletions
This file was deleted.

IGC/VectorCompiler/spirv-patches-10/0006-Simplify-VCExport-opts.patch renamed to IGC/VectorCompiler/spirv-patches-10/0004-Simplify-VCExport-opts.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: nrudenko <[email protected]>
33
Date: Wed, 9 Sep 2020 16:24:41 +0300
4-
Subject: [PATCH 6/8] Simplify VCExport opts
4+
Subject: [PATCH 4/6] Simplify VCExport opts
55

66
---
77
lib/SPIRV/VCExport.cpp | 19 +------------------
88
1 file changed, 1 insertion(+), 18 deletions(-)
99

1010
diff --git a/lib/SPIRV/VCExport.cpp b/lib/SPIRV/VCExport.cpp
11-
index 00000000..00000000 100755
11+
index 0000000..0000000 100755
1212
--- a/lib/SPIRV/VCExport.cpp
1313
+++ b/lib/SPIRV/VCExport.cpp
1414
@@ -23,24 +23,7 @@
@@ -38,5 +38,5 @@ index 00000000..00000000 100755
3838
Opts.setDesiredBIsRepresentation(SPIRV::BIsRepresentation::SPIRVFriendlyIR);
3939
return Opts;
4040
--
41-
2.31.0
41+
2.17.1
4242

0 commit comments

Comments
 (0)