intel-graphics-compiler: upgrade 1.0.8365 -> 1.0.8744

Build vc-intrintics as part of this project as igc expects it to. Remove
the LLVM fixes as they are all available upstream now. Also depend on
-native for invoking elf_packager.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
Anuj Mittal 2021-10-05 00:33:39 +08:00
parent e332560497
commit 2d445772a7
6 changed files with 56 additions and 2933 deletions

View File

@ -1,437 +0,0 @@
From 6247039d9193adf3813375fefc95071e8f5b4097 Mon Sep 17 00:00:00 2001
From: Buildbot <buildbot@xenial.com>
Date: Fri, 27 Aug 2021 07:07:04 +0000
Subject: [PATCH] LLVM 13 fixes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Upstream-Status: Submitted
---
.../LegalizeFunctionSignatures.cpp | 4 ++++
IGC/AdaptorOCL/OCL/sp/spp_g8.cpp | 6 ++++-
IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp | 8 +++++++
IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp | 8 +++++++
IGC/Compiler/GenTTI.cpp | 4 ++++
IGC/Compiler/GenTTI.h | 4 ++++
IGC/Compiler/Optimizer/BuiltInFuncImport.cpp | 4 ++++
IGC/Compiler/Optimizer/CodeAssumption.cpp | 5 ++++
.../AddressSpaceAliasAnalysis.cpp | 23 +++++++++++++++++++
.../PrivateMemory/PrivateMemoryResolution.cpp | 3 +++
IGC/DebugInfo/DwarfDebug.cpp | 8 +++++++
IGC/DebugInfo/StreamEmitter.cpp | 14 ++++++++++-
IGC/ElfPackager/main.cpp | 4 ++++
.../BuiltinsFrontendDefinitions.hpp | 2 +-
.../lib/GenXCodeGen/GenXTargetMachine.h | 4 ++++
.../include/llvmWrapper/Transforms/Scalar.h | 2 +-
IGC/common/LLVMUtils.cpp | 12 ++++++++++
visa/iga/IGALibrary/IR/BitSet.hpp | 2 ++
18 files changed, 113 insertions(+), 4 deletions(-)
diff --git a/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp b/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp
index ee43be301..395f26c91 100644
--- a/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp
+++ b/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp
@@ -377,7 +377,11 @@ void LegalizeFunctionSignatures::FixFunctionBody(Module& M)
}
// Clone the old function body into the new
+#if LLVM_VERSION_MAJOR >= 13
+ CloneFunctionInto(pNewFunc, pFunc, VMap, CloneFunctionChangeType::DifferentModule, Returns);
+#else
CloneFunctionInto(pNewFunc, pFunc, VMap, true, Returns);
+#endif
// Merge the BB for when extra instructions were created
BasicBlock* ClonedEntryBB = cast<BasicBlock>(VMap[&*pFunc->begin()]);
diff --git a/IGC/AdaptorOCL/OCL/sp/spp_g8.cpp b/IGC/AdaptorOCL/OCL/sp/spp_g8.cpp
index 6f7c711bc..8d8c4e50d 100644
--- a/IGC/AdaptorOCL/OCL/sp/spp_g8.cpp
+++ b/IGC/AdaptorOCL/OCL/sp/spp_g8.cpp
@@ -387,7 +387,11 @@ bool createElfFileName(std::string &name, unsigned int maxNameLen, SIMDMode simd
unsigned int mode = sys::fs::perms::all_read | sys::fs::perms::all_write;
// Every '%' will be replaced with a random character (0-9 or a-f), taking care of multithreaded compilations
if (std::error_code EC = sys::fs::createUniqueFile(
- uniqueLockFileName, uniqueLockFileID, resultUniqueLockFileName, mode))
+ uniqueLockFileName, uniqueLockFileID, resultUniqueLockFileName,
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::sys::fs::OF_None,
+#endif
+ mode))
{
IGC_ASSERT_MESSAGE(false, "A uniquely named file not created");
retValue = false;
diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
index 65e672afe..f28136a6a 100644
--- a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
+++ b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
@@ -97,7 +97,11 @@ isOpenCLKernel(SPIRVFunction *BF) {
__attr_unused static void
dumpLLVM(Module *M, const std::string &FName) {
std::error_code EC;
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream FS(FName, EC, sys::fs::OF_None);
+#else
raw_fd_ostream FS(FName, EC, sys::fs::F_None);
+#endif
if (!FS.has_error()) {
FS << *M;
}
@@ -2413,7 +2417,11 @@ SPIRVToLLVM::postProcessFunctionsReturnStruct(Function *F) {
NewArgIt->setName(OldArgIt->getName());
VMap[&*OldArgIt] = &*NewArgIt;
}
+#if LLVM_VERSION_MAJOR >= 13
+ CloneFunctionInto(NewF, F, VMap, CloneFunctionChangeType::DifferentModule, Returns);
+#else
CloneFunctionInto(NewF, F, VMap, true, Returns);
+#endif
auto DL = M->getDataLayout();
const auto ptrSize = DL.getPointerSize();
diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
index ecb045b88..0a0893e4a 100644
--- a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
+++ b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
@@ -67,7 +67,11 @@ namespace igc_spv{
void
saveLLVMModule(Module *M, const std::string &OutputFile) {
std::error_code EC;
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::ToolOutputFile Out(OutputFile.c_str(), EC, sys::fs::OF_None);
+#else
llvm::ToolOutputFile Out(OutputFile.c_str(), EC, sys::fs::F_None);
+#endif
IGC_ASSERT_EXIT_MESSAGE((!EC), "Failed to open file");
IGCLLVM::WriteBitcodeToFile(M, Out.os());
Out.keep();
@@ -326,7 +330,11 @@ mutateCallInst(Module *M, CallInst *CI,
}
}
+#if LLVM_VERSION_MAJOR >= 13
+ CloneFunctionInto(NewF, OldF, VMap, CloneFunctionChangeType::DifferentModule, Returns);
+#else
CloneFunctionInto(NewF, OldF, VMap, true, Returns);
+#endif
// Merge the basic block with Load instruction with the original entry basic block.
BasicBlock* ClonedEntryBB = cast<BasicBlock>(VMap[&*OldF->begin()]);
diff --git a/IGC/Compiler/GenTTI.cpp b/IGC/Compiler/GenTTI.cpp
index 8a74ec287..23c9bc6ed 100644
--- a/IGC/Compiler/GenTTI.cpp
+++ b/IGC/Compiler/GenTTI.cpp
@@ -461,7 +461,11 @@ namespace llvm {
// [LLVM-UPGRADE] moved from getCallCost to getUserCost
// https://github.com/llvm/llvm-project/commit/2641a19981e71c887bece92074e00d1af3e716c9#diff-dd4bd65dc55d754674d9a945a0d22911
+#if LLVM_VERSION_MAJOR >= 13
+ InstructionCost GenIntrinsicsTTIImpl::getUserCost(const User *U, ArrayRef<const Value *> Operands, TTI::TargetCostKind CostKind)
+#else
int GenIntrinsicsTTIImpl::getUserCost(const User *U, ArrayRef<const Value *> Operands, TTI::TargetCostKind CostKind)
+#endif
{
const Function* F = dyn_cast<Function>(U);
if(F != nullptr)
diff --git a/IGC/Compiler/GenTTI.h b/IGC/Compiler/GenTTI.h
index bab1a5c4a..0b3bf4541 100644
--- a/IGC/Compiler/GenTTI.h
+++ b/IGC/Compiler/GenTTI.h
@@ -71,8 +71,12 @@ namespace llvm
, const User * U
#endif
);
+#else
+#if LLVM_VERSION_MAJOR >= 13
+ InstructionCost getUserCost(const User *U, ArrayRef<const Value *> Operands,
#else
int getUserCost(const User *U, ArrayRef<const Value *> Operands,
+#endif
TTI::TargetCostKind CostKind);
#endif
diff --git a/IGC/Compiler/Optimizer/BuiltInFuncImport.cpp b/IGC/Compiler/Optimizer/BuiltInFuncImport.cpp
index e7995ebb4..035bfba85 100644
--- a/IGC/Compiler/Optimizer/BuiltInFuncImport.cpp
+++ b/IGC/Compiler/Optimizer/BuiltInFuncImport.cpp
@@ -880,7 +880,11 @@ void BIImport::removeFunctionBitcasts(Module& M)
pDstFunc,
funcTobeChanged,
operandMap,
+#if LLVM_VERSION_MAJOR >= 13
+ CloneFunctionChangeType::LocalChangesOnly,
+#else
false,
+#endif
Returns,
"");
diff --git a/IGC/Compiler/Optimizer/CodeAssumption.cpp b/IGC/Compiler/Optimizer/CodeAssumption.cpp
index e7208a5fa..3ee9bddca 100644
--- a/IGC/Compiler/Optimizer/CodeAssumption.cpp
+++ b/IGC/Compiler/Optimizer/CodeAssumption.cpp
@@ -272,7 +272,12 @@ bool CodeAssumption::addAssumption(Function* F, AssumptionCache* AC)
// Register assumption
if (AC)
{
+#if LLVM_VERSION_MAJOR >= 13
+ if (auto *aI = dyn_cast<AssumeInst>(assumeInst))
+ AC->registerAssumption(aI);
+#else
AC->registerAssumption(assumeInst);
+#endif
}
assumptionAdded[PN] = 1;
diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
index a2b5927ea..1516e40e8 100644
--- a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
+++ b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
@@ -7,6 +7,9 @@ SPDX-License-Identifier: MIT
============================= end_copyright_notice ===========================*/
#include "llvm/Config/llvm-config.h"
+#if LLVM_VERSION_MAJOR >= 13
+#include <llvm/Analysis/AliasAnalysis.h>
+#endif
#include <llvm/Analysis/TargetLibraryInfo.h>
#include "Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.h"
#include "Compiler/CodeGenPublic.h"
@@ -45,7 +48,11 @@ namespace {
PointerType* PtrTy2 = dyn_cast<PointerType>(LocB.Ptr->getType());
if (!PtrTy1 || !PtrTy2)
+#if LLVM_VERSION_MAJOR >= 13
+ return AliasResult::Kind::NoAlias;
+#else
return NoAlias;
+#endif
unsigned AS1 = PtrTy1->getAddressSpace();
unsigned AS2 = PtrTy2->getAddressSpace();
@@ -62,21 +69,33 @@ namespace {
AS1 != ADDRESS_SPACE_GENERIC &&
AS2 != ADDRESS_SPACE_GENERIC &&
AS1 != AS2)
+#if LLVM_VERSION_MAJOR >= 13
+ return AliasResult::Kind::NoAlias;
+#else
return NoAlias;
+#endif
// Shared local memory doesn't alias any statefull memory.
if ((AS1 == ADDRESS_SPACE_LOCAL && AS2 > ADDRESS_SPACE_NUM_ADDRESSES) ||
(AS1 > ADDRESS_SPACE_NUM_ADDRESSES && AS2 == ADDRESS_SPACE_LOCAL))
{
+#if LLVM_VERSION_MAJOR >= 13
+ return AliasResult::Kind::NoAlias;
+#else
return NoAlias;
+#endif
}
// Private memory doesn't alias any stateful memory
if ((AS1 == ADDRESS_SPACE_PRIVATE && AS2 > ADDRESS_SPACE_NUM_ADDRESSES) ||
(AS1 > ADDRESS_SPACE_NUM_ADDRESSES && AS2 == ADDRESS_SPACE_PRIVATE))
{
+#if LLVM_VERSION_MAJOR >= 13
+ return AliasResult::Kind::NoAlias;
+#else
return NoAlias;
+#endif
}
@@ -108,7 +127,11 @@ namespace {
if ((resourceType[0] != resourceType[1]) || // different resource types
(isDirectAccess[0] && isDirectAccess[1] && resourceIndex[0] != resourceIndex[1])) // direct access to different BTIs
{
+#if LLVM_VERSION_MAJOR >= 13
+ return AliasResult::Kind::NoAlias;
+#else
return NoAlias;
+#endif
}
}
}
diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
index 48c7e8637..8b9618284 100644
--- a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
+++ b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
@@ -17,6 +17,9 @@ SPDX-License-Identifier: MIT
#include "llvmWrapper/IR/DerivedTypes.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/IR/DataLayout.h"
+#if LLVM_VERSION_MAJOR >= 13
+#include "llvm/IR/DebugInfo.h"
+#endif
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Dominators.h"
#include "common/LLVMWarningsPop.hpp"
diff --git a/IGC/DebugInfo/DwarfDebug.cpp b/IGC/DebugInfo/DwarfDebug.cpp
index f57dd72cb..d984fe86f 100644
--- a/IGC/DebugInfo/DwarfDebug.cpp
+++ b/IGC/DebugInfo/DwarfDebug.cpp
@@ -857,9 +857,17 @@ CompileUnit* DwarfDebug::constructCompileUnit(DICompileUnit* DIUnit)
{
std::string str;
str = "Intel OpenCL ";
+#if LLVM_VERSION_MAJOR >= 13
+ str += toString(op1->getValue()->getUniqueInteger(), 10, false);
+#else
str += op1->getValue()->getUniqueInteger().toString(10, false);
+#endif
str += ".";
+#if LLVM_VERSION_MAJOR >= 13
+ str += toString(op2->getValue()->getUniqueInteger(), 10, false);
+#else
str += op2->getValue()->getUniqueInteger().toString(10, false);
+#endif
NewCU->addString(Die, dwarf::DW_AT_description, llvm::StringRef(str));
}
diff --git a/IGC/DebugInfo/StreamEmitter.cpp b/IGC/DebugInfo/StreamEmitter.cpp
index a38a445d5..e9a5b6279 100644
--- a/IGC/DebugInfo/StreamEmitter.cpp
+++ b/IGC/DebugInfo/StreamEmitter.cpp
@@ -391,11 +391,23 @@ StreamEmitter::StreamEmitter(raw_pwrite_stream& outStream,
MCRegisterInfo* regInfo = nullptr;
+ Triple triple = Triple(GetTargetTriple());
+
+#if LLVM_VERSION_MAJOR >= 13
+ // Create new MC context
+ m_pContext = new MCContext(Triple(GetTargetTriple()),
+ (const llvm::MCAsmInfo*)m_pAsmInfo, regInfo,
+ /*MSTI=*/(const llvm::MCSubtargetInfo *)nullptr, m_pSrcMgr);
+
+ m_pObjFileInfo->initMCObjectFileInfo(*m_pContext, false);
+
+ m_pContext->setObjectFileInfo(m_pObjFileInfo);
+#else
// Create new MC context
m_pContext = new MCContext((const llvm::MCAsmInfo*)m_pAsmInfo, regInfo, m_pObjFileInfo, m_pSrcMgr);
- Triple triple = Triple(GetTargetTriple());
m_pObjFileInfo->InitMCObjectFileInfo(Triple(GetTargetTriple()), false, *m_pContext);
+#endif
bool is64Bit = GetPointerSize() == 8;
uint8_t osABI = MCELFObjectTargetWriter::getOSABI(triple.getOS());
diff --git a/IGC/ElfPackager/main.cpp b/IGC/ElfPackager/main.cpp
index 38a5001c1..5f4d87d96 100644
--- a/IGC/ElfPackager/main.cpp
+++ b/IGC/ElfPackager/main.cpp
@@ -177,7 +177,11 @@ std::unique_ptr<IGCLLVM::Module> LocalCloneModule(
}
SmallVector<ReturnInst*, 8> Returns; // Ignore returns cloned.
+#if LLVM_VERSION_MAJOR >= 13
+ CloneFunctionInto(F, &*I, VMap, CloneFunctionChangeType::DifferentModule, Returns);
+#else
CloneFunctionInto(F, &*I, VMap, /*ModuleLevelChanges=*/true, Returns);
+#endif
}
if (I->hasPersonalityFn())
diff --git a/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp b/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp
index b5f66f048..568b42c07 100644
--- a/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp
+++ b/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp
@@ -5028,7 +5028,7 @@ llvm::Value* LLVM3DBuilder<preserveNames, T, Inserter>::ScalarsToVector(
IGC_ASSERT(nullptr != resultType);
llvm::Value* result = llvm::UndefValue::get(resultType);
- for (unsigned i = 0; i < llvm::cast<llvm::VectorType>(resultType)->getNumElements(); i++)
+ for (unsigned i = 0; i < llvm::cast<IGCLLVM::FixedVectorType>(resultType)->getNumElements(); i++)
{
IGC_ASSERT(nullptr != scalars[i]);
IGC_ASSERT(llvm::cast<llvm::VectorType>(resultType)->getElementType() == scalars[i]->getType());
diff --git a/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h b/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h
index f90bc1bc0..8ce06e93f 100644
--- a/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h
+++ b/IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.h
@@ -97,7 +97,11 @@ public:
bool shouldBuildLookupTables() { return false; }
unsigned getFlatAddressSpace() { return 4; }
+#if LLVM_VERSION_MAJOR >= 13
+ InstructionCost getUserCost(const User *U, ArrayRef<const Value *> Operands
+#else
int getUserCost(const User *U, ArrayRef<const Value *> Operands
+#endif
#if LLVM_VERSION_MAJOR >= 11
,
TTI::TargetCostKind CostKind
diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
index 1df041372..022141d15 100644
--- a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
+++ b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
@@ -26,7 +26,7 @@ namespace IGCLLVM
{
return llvm::createLoopUnrollPass(OptLevel, false, Threshold, Count, AllowPartial, Runtime, UpperBound, AllowPeeling);
}
-#elif LLVM_VERSION_MAJOR >= 9 && LLVM_VERSION_MAJOR <= 12
+#elif LLVM_VERSION_MAJOR >= 9 && LLVM_VERSION_MAJOR <= 13
inline static llvm::Pass * createLoopUnrollPass(
int OptLevel = 2, int Threshold = -1, int Count = -1,
int AllowPartial = -1, int Runtime = -1,
diff --git a/IGC/common/LLVMUtils.cpp b/IGC/common/LLVMUtils.cpp
index ed2cfc413..ae9df5d63 100644
--- a/IGC/common/LLVMUtils.cpp
+++ b/IGC/common/LLVMUtils.cpp
@@ -132,7 +132,11 @@ bool IGCPassManager::isInList(const StringRef& N, const StringRef& List) const
size_t endPos = List.find_first_of(Separators, startPos);
size_t len = (endPos != StringRef::npos ? endPos - startPos : endPos);
StringRef Name = List.substr(startPos, len);
+#if LLVM_VERSION_MAJOR >= 13
+ if (Name.equals_insensitive(N))
+#else
if (Name.equals_lower(N))
+#endif
{
return true;
}
@@ -149,7 +153,11 @@ bool IGCPassManager::isPrintBefore(Pass* P)
// or pass command args registered in passInfo.
StringRef passNameList(IGC_GET_REGKEYSTRING(PrintBefore));
StringRef PN = P->getPassName();
+#if LLVM_VERSION_MAJOR >= 13
+ if (passNameList.equals_insensitive("all") || isInList(PN, passNameList))
+#else
if (passNameList.equals_lower("all") || isInList(PN, passNameList))
+#endif
return true;
// further check passInfo
@@ -173,7 +181,11 @@ bool IGCPassManager::isPrintAfter(Pass* P)
// or pass command args registered in passInfo.
StringRef passNameList(IGC_GET_REGKEYSTRING(PrintAfter));
StringRef PN = P->getPassName();
+#if LLVM_VERSION_MAJOR >= 13
+ if (passNameList.equals_insensitive("all") || isInList(PN, passNameList))
+#else
if (passNameList.equals_lower("all") || isInList(PN, passNameList))
+#endif
return true;
// further check passInfo
diff --git a/visa/iga/IGALibrary/IR/BitSet.hpp b/visa/iga/IGALibrary/IR/BitSet.hpp
index 43b0d3f92..c6cdd430a 100644
--- a/visa/iga/IGALibrary/IR/BitSet.hpp
+++ b/visa/iga/IGALibrary/IR/BitSet.hpp
@@ -12,6 +12,8 @@ SPDX-License-Identifier: MIT
#include "../asserts.hpp"
#include "common/secure_mem.h"
+#include <stdexcept>
+#include <limits>
#include <algorithm>
#include <bitset>
#include <cstdint>
--
2.31.1

View File

@ -0,0 +1,35 @@
From 3d99559779d628704568879a2ee51e968e66d005 Mon Sep 17 00:00:00 2001
From: Anuj Mittal <anuj.mittal@intel.com>
Date: Tue, 5 Oct 2021 00:11:26 +0800
Subject: [PATCH] llvm_deps.cmake: don't copy header file when building
We build in pre-built mode and this header shouldn't be copied in
that case.
Upstream-Status: Pending
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
external/llvm/llvm_deps.cmake | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/external/llvm/llvm_deps.cmake b/external/llvm/llvm_deps.cmake
index 425d3766f..e43804f77 100644
--- a/external/llvm/llvm_deps.cmake
+++ b/external/llvm/llvm_deps.cmake
@@ -46,9 +46,9 @@ if(IGC_OPTION__LLVM_LLD)
include(llvm_lld_source_hook)
if(NOT EXISTS "${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o" AND ${IGC_OPTION__LLVM_PREFERRED_VERSION} GREATER_EQUAL "12.0.0")
# Need to copy one header from unwind package for LLD (only for building from sources)
- file(MAKE_DIRECTORY ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o)
- file(COPY ${DEFAULT_IGC_LLVM_SOURCES_DIR}/libunwind/include/mach-o/compact_unwind_encoding.h
- DESTINATION ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o/)
+ #file(MAKE_DIRECTORY ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o)
+ #file(COPY ${DEFAULT_IGC_LLVM_SOURCES_DIR}/libunwind/include/mach-o/compact_unwind_encoding.h
+ # DESTINATION ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o/)
endif()
endif()
--
2.32.0

View File

@ -1,44 +0,0 @@
From 562a19fe7ef3f4732365efdfc6d2a30763a5b8b0 Mon Sep 17 00:00:00 2001
From: Dongwon Kim <dongwon.kim@intel.com>
Date: Wed, 18 Aug 2021 18:49:49 -0700
Subject: [PATCH 1/5] skip execution of ElfPackager
ElfPackager adds the ability to convert llvm bitcode into elf files for
easier partitioning. Skip for now until we start building a native
version for this.
Upstream-Status: Inappropriate [configuration specific]
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
IGC/ElfPackager/CMakeLists.txt | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/IGC/ElfPackager/CMakeLists.txt b/IGC/ElfPackager/CMakeLists.txt
index 8959a3ebb..7c3a0b42f 100644
--- a/IGC/ElfPackager/CMakeLists.txt
+++ b/IGC/ElfPackager/CMakeLists.txt
@@ -51,12 +51,12 @@ if(NOT TARGET ${IGC_BUILD__PROJ__ElfPackager})
${IGC_SOURCE_DIR}/AdaptorOCL/CLElfLib/
)
- if(NOT ANDROID)
- add_custom_command(TARGET ${IGC_BUILD__PROJ__ElfPackager}
- POST_BUILD
- COMMAND $<TARGET_FILE:${IGC_BUILD__PROJ__ElfPackager}> -includeSizet -funcList ${CMAKE_CURRENT_SOURCE_DIR}/function_bin.txt ${IGC_BUILD__BIF_DIR}/OCLBiFImpl.bc ${IGC_BUILD__BIF_DIR}/igdclbif.bin
- )
- endif()
+# if(NOT ANDROID)
+# add_custom_command(TARGET ${IGC_BUILD__PROJ__ElfPackager}
+# POST_BUILD
+# COMMAND $<TARGET_FILE:${IGC_BUILD__PROJ__ElfPackager}> -includeSizet -funcList ${CMAKE_CURRENT_SOURCE_DIR}/function_bin.txt ${IGC_BUILD__BIF_DIR}/OCLBiFImpl.bc ${IGC_BUILD__BIF_DIR}/igdclbif.bin
+# )
+# endif()
add_dependencies("${IGC_BUILD__PROJ__ElfPackager}" "${IGC_BUILD__PROJ__BiFModule_OCL}")
--
2.20.1

View File

@ -1,47 +0,0 @@
From 92a663dd55917fdfad5ae4daa173a9d18df0ee9e Mon Sep 17 00:00:00 2001
From: Dongwon Kim <dongwon.kim@intel.com>
Date: Wed, 18 Aug 2021 19:14:28 -0700
Subject: [PATCH 2/5] IGC/VectorCompiler/CMakeLists.txt: link to external
LLVMGenXIntrinsics
By default LLVMGenXIntrinsics is to be build In-tree, but we want to
link externally.
Upstream-Status: Inappropriate [configuration specific]
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
IGC/VectorCompiler/CMakeLists.txt | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/IGC/VectorCompiler/CMakeLists.txt b/IGC/VectorCompiler/CMakeLists.txt
index 0b26072f0..bf1cd939d 100644
--- a/IGC/VectorCompiler/CMakeLists.txt
+++ b/IGC/VectorCompiler/CMakeLists.txt
@@ -43,22 +43,6 @@ if(LLVM_ON_WIN32)
endif()
# --- VC Intrinsics ---
-
-if(DEFINED VC_INTRINSICS_SRC)
- set(INTRSRC "${VC_INTRINSICS_SRC}/GenXIntrinsics")
-endif()
-
-if(NOT DEFINED INTRSRC)
- set(INTRSRC "${CMAKE_CURRENT_SOURCE_DIR}/../../../vc-intrinsics/GenXIntrinsics")
-endif()
-
-message(STATUS "[VC] Using vc-intrinsics source from: ${INTRSRC}")
-# Trick intrinsics.
-set(BUILD_EXTERNAL YES)
-# We are using prebuilt SPIRV and building intrinsics.
-set(INTRBUILD "${CMAKE_CURRENT_BINARY_DIR}/intrbuild")
-add_subdirectory(${INTRSRC} ${INTRBUILD} EXCLUDE_FROM_ALL)
-
include(cmake/spirv.cmake)
set(IGC_OPTION__VC_DISABLE_BIF_DEFAULT OFF)
--
2.20.1

View File

@ -8,16 +8,15 @@ LIC_FILES_CHKSUM = "file://IGC/BiFModule/Implementation/ExternalLibraries/libclc
file://IGC/Compiler/LegalizationPass.cpp;beginline=1;endline=23;md5=4a985f2545dd5a846e205b1e60a51cd9 \
file://NOTICES.txt;md5=db621145dfb627436bc90ad600386801"
SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https; \
file://0001-skip-execution-of-ElfPackager.patch \
file://0002-IGC-VectorCompiler-CMakeLists.txt-link-to-external-L.patch \
SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https;name=igc \
git://github.com/intel/vc-intrinsics.git;protocol=https;destsuffix=git/vc-intrinsics;name=vc \
file://0001-llvm_deps.cmake-don-t-copy-header-file-when-building.patch \
file://0003-Improve-Reproducibility-for-src-package.patch \
file://0004-find-external-llvm-tblgen.patch \
file://0005-Temporary-LLVM-12-compatiblity-fix.patch \
file://0001-LLVM-13-fixes.patch \
"
"
SRCREV = "5d5672d6cc0c415dae76648390026f777004bd99"
SRCREV_igc = "3ba8dde8c414a0e47df58b1bba12a64f8ba2089e"
SRCREV_vc = "e5ad7e02aa4aa21a3cd7b3e5d1f3ec9b95f58872"
# Used to replace with relative path in reproducibility patch
export B
@ -26,17 +25,28 @@ S = "${WORKDIR}/git"
inherit cmake
CXXFLAGS:append = " -Wno-error=deprecated-declarations"
CXXFLAGS:append = " -Wno-error=nonnull"
COMPATIBLE_HOST = '(x86_64).*-linux'
COMPATIBLE_HOST:libc-musl = "null"
DEPENDS += " flex-native bison-native clang opencl-clang vc-intrinsics"
DEPENDS:append:class-target = " clang-cross-x86_64"
DEPENDS += " flex-native bison-native clang opencl-clang"
DEPENDS:append:class-target = " clang-cross-x86_64 intel-graphics-compiler-native"
RDEPENDS:${PN} += "opencl-clang"
EXTRA_OECMAKE = "-DIGC_OPTION__LLVM_PREFERRED_VERSION=${LLVMVERSION} -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 -DIGC_BUILD__VC_ENABLED=OFF -DIGC_BUILD__USE_KHRONOS_SPIRV_TRANSLATOR=ON"
EXTRA_OECMAKE = " \
-DIGC_OPTION__LLVM_PREFERRED_VERSION=${LLVMVERSION} \
-DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
-DVC_INTRINSICS_SRC="${S}/vc-intrinsics" \
-DIGC_OPTION__LLVM_MODE=Prebuilds \
-DIGC_BUILD__VC_ENABLED=OFF \
"
do_install:append:class-native () {
install -d ${D}${bindir}
install ${B}/IGC/Release/elf_packager ${D}${bindir}/
}
BBCLASSEXTEND = "native nativesdk"