Skip to content

Commit dcb6f89

Browse files
Update spirv-llvm-translator.conf
Signed-off-by: Whitney Tsang <[email protected]>
1 parent d59f085 commit dcb6f89

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

third_party/intel/cmake/3388.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp
2-
index d363f060a..28f83d661 100644
2+
index ec4ec41f5..4f6d80dd1 100644
33
--- a/lib/SPIRV/SPIRVWriter.cpp
44
+++ b/lib/SPIRV/SPIRVWriter.cpp
5-
@@ -4211,20 +4211,6 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
5+
@@ -4276,20 +4276,6 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
66
// -spirv-allow-unknown-intrinsics work correctly.
77
auto IID = II->getIntrinsicID();
88
switch (IID) {
@@ -23,7 +23,7 @@ index d363f060a..28f83d661 100644
2323
case Intrinsic::assume: {
2424
// llvm.assume translation is currently supported only within
2525
// SPV_KHR_expect_assume extension, ignore it otherwise, since it's
26-
@@ -5508,11 +5494,6 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI,
26+
@@ -5721,11 +5707,6 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI,
2727
SmallVector<std::string, 2> Dec;
2828
if (isBuiltinTransToExtInst(CI->getCalledFunction(), &ExtSetKind, &ExtOp,
2929
&Dec)) {
@@ -36,10 +36,10 @@ index d363f060a..28f83d661 100644
3636
auto *FormatStrPtr = cast<PointerType>(CI->getArgOperand(0)->getType());
3737
if (FormatStrPtr->getAddressSpace() !=
3838
diff --git a/lib/SPIRV/libSPIRV/SPIRVModule.cpp b/lib/SPIRV/libSPIRV/SPIRVModule.cpp
39-
index a680574ec..2ff1df097 100644
39+
index b76987e93..8d06ee792 100644
4040
--- a/lib/SPIRV/libSPIRV/SPIRVModule.cpp
4141
+++ b/lib/SPIRV/libSPIRV/SPIRVModule.cpp
42-
@@ -1732,8 +1732,6 @@ SPIRVInstruction *SPIRVModuleImpl::addBinaryInst(Op TheOpCode, SPIRVType *Type,
42+
@@ -1739,8 +1739,6 @@ SPIRVInstruction *SPIRVModuleImpl::addBinaryInst(Op TheOpCode, SPIRVType *Type,
4343
SPIRVValue *Op1,
4444
SPIRVValue *Op2,
4545
SPIRVBasicBlock *BB) {
@@ -48,10 +48,10 @@ index a680574ec..2ff1df097 100644
4848
return addInstruction(SPIRVInstTemplateBase::create(
4949
TheOpCode, Type, getId(),
5050
getVec(Op1->getId(), Op2->getId()), BB, this),
51-
@@ -1757,8 +1755,6 @@ SPIRVInstruction *SPIRVModuleImpl::addUnaryInst(Op TheOpCode,
52-
SPIRVType *TheType,
53-
SPIRVValue *Op,
54-
SPIRVBasicBlock *BB) {
51+
@@ -1764,8 +1762,6 @@ SPIRVInstruction *
52+
SPIRVModuleImpl::addUnaryInst(Op TheOpCode, SPIRVType *TheType, SPIRVValue *Op,
53+
SPIRVBasicBlock *BB,
54+
SPIRVInstruction *InsertBefore) {
5555
- if (TheType->isTypeFloat(16, FPEncodingBFloat16KHR) && TheOpCode != OpDot)
5656
- addCapability(internal::CapabilityBFloat16ArithmeticINTEL);
5757
return addInstruction(

third_party/intel/cmake/FindSPIRVToLLVMTranslator.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ if (NOT SPIRVToLLVMTranslator_FOUND)
123123
if(NOT PATCH_RESULT EQUAL 0)
124124
message(FATAL_ERROR "Failed to apply revert_3406.patch to SPIRV-LLVM-Translator")
125125
endif()
126+
execute_process(
127+
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/revert_3407.patch
128+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
129+
ERROR_QUIET
130+
RESULT_VARIABLE PATCH_RESULT
131+
)
132+
if(PATCH_RESULT EQUAL 0)
133+
execute_process(
134+
COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/revert_3407.patch
135+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
136+
RESULT_VARIABLE PATCH_RESULT
137+
)
138+
else()
139+
execute_process( # Check if the patch is already applied
140+
COMMAND git apply --reverse --check ${CMAKE_CURRENT_LIST_DIR}/revert_3407.patch
141+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
142+
RESULT_VARIABLE PATCH_RESULT
143+
)
144+
endif()
145+
if(NOT PATCH_RESULT EQUAL 0)
146+
message(FATAL_ERROR "Failed to apply revert_3407.patch to SPIRV-LLVM-Translator")
147+
endif()
126148
endif()
127149

128150
set(SPIRVToLLVMTranslator_INCLUDE_DIR "${SPIRVToLLVMTranslator_SOURCE_DIR}/include"

third_party/intel/cmake/revert_3407.patch

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
daba8b217bc266806ac00095262d1af0ba2ee610
1+
af594c0b45250fefa2093dfc31cb14d1eb6a32f2

0 commit comments

Comments
 (0)