intel-graphics-compiler: upgrade 1.0.6083 -> 1.0.6410

Patches applied from Open PR#171, in order to build with llvm-12.
https://github.com/intel/intel-graphics-compiler/pull/171

Error logs:
(1)
|
/build/tmp/work/corei7-64-poky-linux/intel-graphics-compiler/1.0.6410-r0/git/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.hpp:83:56:
error: 'unsigned int llvm::VectorType::getNumElements() const' is
deprecated: Calling this function via a base VectorType is deprecated.
Either call getElementCount() and handle the case where Scalable is true
or cast to FixedVectorType. [-Werror=deprecated-declarations]
|    83 |             NumElts = VTy ? (short)VTy->getNumElements() : 1;

Ref:867de151a5

(2)
|
/build/tmp/work/corei7-64-poky-linux/intel-graphics-compiler/1.0.6410-r0/git/IGC/common/igc_resourceDimTypes.h:69:23:
error: 'const class llvm::Module' has no member named 'getTypeByName'
|    69 |         return
module.getTypeByName(ResourceDimensionTypeName[resourceDimTypeId]);

Ref:
fe43168348

Update copyright year in headers in IGC Compiler and some format updates.

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
Naveen Saini 2021-03-26 18:39:15 +08:00 committed by Anuj Mittal
parent 39457fee8e
commit a766df8081
4 changed files with 2880 additions and 4 deletions

View File

@ -0,0 +1,318 @@
From 60136b453bb3a109bfc88c4040b871af9d522ed5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= <zboszor@pr.hu>
Date: Thu, 25 Feb 2021 19:40:21 +0100
Subject: [PATCH 2/3] Review fixes for LLVM 12 phase 1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Pending
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp | 6 +-----
IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp | 6 +-----
IGC/Compiler/CISACodeGen/AdvMemOpt.cpp | 7 ++-----
IGC/Compiler/CISACodeGen/Simd32Profitability.cpp | 7 ++-----
IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp | 11 +----------
IGC/Compiler/GenTTI.cpp | 9 ++-------
IGC/Compiler/Legalizer/InstPromoter.cpp | 8 +-------
.../DeviceEnqueueFuncs/TransformBlocks.cpp | 6 +-----
.../OpenCLPasses/WIFuncs/WIFuncResolution.cpp | 4 ----
IGC/Compiler/Optimizer/Scalarizer.cpp | 2 +-
IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h | 10 ++++++++++
.../include/llvmWrapper/Support/TypeSize.h | 4 +---
.../include/llvmWrapper/Transforms/Utils/LoopUtils.h | 8 ++++++++
IGC/common/igc_resourceDimTypes.h | 5 ++---
14 files changed, 33 insertions(+), 60 deletions(-)
diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
index 725a1512..12f42be8 100644
--- a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
+++ b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
@@ -1929,11 +1929,7 @@ SPIRVToLLVM::transType(SPIRVType *T) {
auto name = isSubgroupAvcINTELTypeOpCode(OC) ?
OCLSubgroupINTELTypeOpCodeMap::rmap(OC) :
BuiltinOpaqueGenericTypeOpCodeMap::rmap(OC);
-#if LLVM_VERSION_MAJOR >= 12
- auto *pST = llvm::StructType::getTypeByName(M->getContext(), name);
-#else
- auto *pST = M->getTypeByName(name);
-#endif
+ auto *pST = IGCLLVM::getTypeByName(M, name);
pST = pST ? pST : StructType::create(*Context, name);
return mapType(T, PointerType::get(pST, getOCLOpaqueTypeAddrSpace(OC)));
diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
index 91b4623c..f4f0dee5 100644
--- a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
+++ b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
@@ -93,11 +93,7 @@ saveLLVMModule(Module *M, const std::string &OutputFile) {
PointerType*
getOrCreateOpaquePtrType(Module *M, const std::string &Name,
unsigned AddrSpace) {
-#if LLVM_VERSION_MAJOR >= 12
- auto OpaqueType = llvm::StructType::getTypeByName(M->getContext(), Name);
-#else
- auto OpaqueType = M->getTypeByName(Name);
-#endif
+ auto OpaqueType = IGCLLVM::getTypeByName(M, Name);
if (!OpaqueType)
OpaqueType = StructType::create(M->getContext(), Name);
return PointerType::get(OpaqueType, AddrSpace);
diff --git a/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp b/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
index fc45a510..a612a473 100644
--- a/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
+++ b/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
@@ -33,6 +33,7 @@ IN THE SOFTWARE.
#include <llvm/Support/Debug.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/Transforms/Utils/Local.h>
+#include "llvmWrapper/Transforms/Utils/LoopUtils.h"
#include "common/LLVMWarningsPop.hpp"
#include "GenISAIntrinsics/GenIntrinsics.h"
#include "Compiler/CISACodeGen/ShaderCodeGen.hpp"
@@ -134,11 +135,7 @@ bool AdvMemOpt::runOnFunction(Function& F) {
for (auto I = LI->begin(), E = LI->end(); I != E; ++I)
for (auto DFI = df_begin(*I), DFE = df_end(*I); DFI != DFE; ++DFI) {
Loop* L = *DFI;
-#if LLVM_VERSION_MAJOR >= 12
- if (L->isInnermost())
-#else
- if (L->empty())
-#endif
+ if (IGCLLVM::isInnermost(L))
InnermostLoops.push_back(L);
}
diff --git a/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp b/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
index c1f4a419..5393d4e8 100644
--- a/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
+++ b/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
@@ -28,6 +28,7 @@ IN THE SOFTWARE.
#include "Compiler/CISACodeGen/Platform.hpp"
#include "common/LLVMWarningsPush.hpp"
#include <llvmWrapper/IR/DerivedTypes.h>
+#include <llvmWrapper/Transforms/Utils/LoopUtils.h>
#include <llvm/IR/InstIterator.h>
#include <llvm/IR/Operator.h>
#include <llvmWrapper/IR/DerivedTypes.h>
@@ -995,11 +996,7 @@ static bool hasLongStridedLdStInLoop(Function* F, LoopInfo* LI, WIAnalysis* WI)
// Collect innermost simple loop.
for (auto I = LI->begin(), E = LI->end(); I != E; ++I) {
auto L = *I;
-#if LLVM_VERSION_MAJOR >= 12
- if (!L->isInnermost())
-#else
- if (!L->empty())
-#endif
+ if (!IGCLLVM::isInnermost(L))
continue;
if (L->getNumBlocks() != 2)
continue;
diff --git a/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp b/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
index adf992cb..33473c23 100644
--- a/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
+++ b/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
@@ -153,21 +153,12 @@ void ConvertMSAAPayloadTo16Bit::visitCallInst(CallInst& I)
// In OGL there are uses of ldmcs other then ldms, using vec4float type.
// Fix them to use newly created 16bit ldmcs.
if (ldmcs->getType()->isVectorTy() &&
-#if LLVM_VERSION_MAJOR >= 12
- ldmcs->getType()->getScalarType()->isFloatTy())
-#else
- ldmcs->getType()->getVectorElementType()->isFloatTy())
-#endif
+ cast<IGCLLVM::FixedVectorType>(ldmcs->getType())->getElementType()->isFloatTy())
{
m_builder->SetInsertPoint(ldmcs);
-#if LLVM_VERSION_MAJOR >= 12
uint ldmcsNumOfElements = cast<IGCLLVM::FixedVectorType>(ldmcs->getType())->getNumElements();
uint new_mcs_callNumOfElements = cast<IGCLLVM::FixedVectorType>(new_mcs_call->getType())->getNumElements();
-#else
- uint ldmcsNumOfElements = ldmcs->getType()->getVectorNumElements();
- uint new_mcs_callNumOfElements = new_mcs_call->getType()->getVectorNumElements();
-#endif
// vec of 16bit ints to vec of 32bit ints
Type* new_mcs_callVecType = IGCLLVM::FixedVectorType::get(m_builder->getInt32Ty(), new_mcs_callNumOfElements);
diff --git a/IGC/Compiler/GenTTI.cpp b/IGC/Compiler/GenTTI.cpp
index 9e4d2f26..53e3ec9e 100644
--- a/IGC/Compiler/GenTTI.cpp
+++ b/IGC/Compiler/GenTTI.cpp
@@ -37,6 +37,7 @@ IN THE SOFTWARE.
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvmWrapper/Transforms/Utils/LoopUtils.h"
#include "common/LLVMWarningsPop.hpp"
using namespace llvm;
@@ -216,13 +217,7 @@ namespace llvm {
// Skip non-simple loop.
if (L->getNumBlocks() != 1) {
- if (IGC_IS_FLAG_ENABLED(EnableAdvRuntimeUnroll) &&
-#if LLVM_VERSION_MAJOR >= 12
- L->isInnermost()
-#else
- L->empty()
-#endif
- ) {
+ if (IGC_IS_FLAG_ENABLED(EnableAdvRuntimeUnroll) && IGCLLVM::isInnermost(L)) {
auto countNonPHI = [](BasicBlock* BB) {
unsigned Total = BB->size();
unsigned PHIs = 0;
diff --git a/IGC/Compiler/Legalizer/InstPromoter.cpp b/IGC/Compiler/Legalizer/InstPromoter.cpp
index 8fadf89f..63cbccb5 100644
--- a/IGC/Compiler/Legalizer/InstPromoter.cpp
+++ b/IGC/Compiler/Legalizer/InstPromoter.cpp
@@ -398,13 +398,7 @@ bool InstPromoter::visitBitCastInst(BitCastInst& I) {
IRB->CreateBitCast(Val, IGCLLVM::FixedVectorType::get(DestTy->getScalarType(), N));
std::vector<Constant*> Vals;
- for (unsigned i = 0;
-#if LLVM_VERSION_MAJOR >= 12
- i < cast<IGCLLVM::FixedVectorType>(DestTy)->getNumElements();
-#else
- i < DestTy->getVectorNumElements();
-#endif
- i++)
+ for (unsigned i = 0; i < cast<IGCLLVM::FixedVectorType>(DestTy)->getNumElements(); i++)
Vals.push_back(IRB->getInt32(i));
Value* Mask = ConstantVector::get(Vals);
diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
index 119520ed..a3681b79 100644
--- a/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
+++ b/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
@@ -952,11 +952,7 @@ namespace //Anonymous
{
auto ndrangeStructName = "struct.ndrange_t";
auto module = _deviceExecCall->getModule();
-#if LLVM_VERSION_MAJOR >= 12
- auto ndrangeTy = llvm::StructType::getTypeByName(module->getContext(), ndrangeStructName);
-#else
- auto ndrangeTy = module->getTypeByName(ndrangeStructName);
-#endif
+ auto ndrangeTy = IGCLLVM::getTypeByName(module, ndrangeStructName);
if (ndrangeTy == nullptr)
{
//create struct type
diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
index 535d6268..c23c661d 100644
--- a/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
+++ b/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
@@ -303,11 +303,7 @@ static Value* BuildLoadInst(CallInst& CI, unsigned int Offset, Type* DataType)
auto Size = ElemByteSize;
if (DataType->isVectorTy())
{
-#if LLVM_VERSION_MAJOR >= 12
Size *= cast<IGCLLVM::FixedVectorType>(DataType)->getNumElements();
-#else
- Size *= DataType->getVectorNumElements();
-#endif
}
unsigned int AlignedOffset = (Offset / ElemByteSize) * ElemByteSize;
unsigned int LoadByteSize = (Offset == AlignedOffset) ? Size : Size * 2;
diff --git a/IGC/Compiler/Optimizer/Scalarizer.cpp b/IGC/Compiler/Optimizer/Scalarizer.cpp
index a4e73a6d..38627553 100644
--- a/IGC/Compiler/Optimizer/Scalarizer.cpp
+++ b/IGC/Compiler/Optimizer/Scalarizer.cpp
@@ -778,7 +778,7 @@ void ScalarizeFunction::scalarizeInstruction(ShuffleVectorInst* SI)
// Generate array for shuffled scalar values
SmallVector<Value*, MAX_INPUT_VECTOR_WIDTH>newVector;
- unsigned width = int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(SI->getType())->getNumElements());
+ unsigned width = int_cast<unsigned>(cast<IGCLLVM::FixedVectorType>(SI->getType())->getNumElements());
// Generate undef value, which may be needed as some scalar elements
UndefValue* undef = UndefValue::get(inputType->getElementType());
diff --git a/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h b/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h
index a3f5a0b8..6a5407bb 100644
--- a/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h
+++ b/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h
@@ -29,6 +29,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/Module.h"
namespace IGCLLVM
{
@@ -62,6 +63,15 @@ namespace IGCLLVM
return false;
#endif
}
+
+ inline llvm::StructType *getTypeByName(llvm::Module *M, llvm::StringRef Name) {
+#if LLVM_VERSION_MAJOR >= 12
+ return llvm::StructType::getTypeByName(M->getContext(), Name);
+#else
+ return M->getTypeByName(Name);
+#endif
+ }
+
}
#endif
diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h b/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
index 30e29720..7021820c 100644
--- a/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
+++ b/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
@@ -39,12 +39,10 @@ inline unsigned getElementCount(unsigned EC) { return EC; }
inline ElementCount getElementCount(unsigned EC) {
return ElementCount(EC, false);
}
-#elif LLVM_VERSION_MAJOR == 12
+#else
inline ElementCount getElementCount(unsigned EC) {
return ElementCount::get(EC, false);
}
-#else
-#error "unsupported LLVM version"
#endif
} // namespace IGCLLVM
diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h
index db47b00b..bce9cfc1 100644
--- a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h
+++ b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h
@@ -41,6 +41,14 @@ namespace IGCLLVM
return llvm::InsertPreheaderForLoop(L, DT, LI, nullptr, PreserveLCSSA);
}
#endif
+
+ inline bool isInnermost(llvm::Loop *L) {
+#if LLVM_VERSION_MAJOR >= 12
+ return L->isInnermost();
+#else
+ return L->empty();
+#endif
+ }
}
#endif
diff --git a/IGC/common/igc_resourceDimTypes.h b/IGC/common/igc_resourceDimTypes.h
index d790330f..2d675969 100644
--- a/IGC/common/igc_resourceDimTypes.h
+++ b/IGC/common/igc_resourceDimTypes.h
@@ -67,10 +67,9 @@ namespace IGC
resourceDimTypeId == DIM_3D_TYPE || resourceDimTypeId == DIM_CUBE_TYPE || resourceDimTypeId == DIM_CUBE_ARRAY_TYPE));
#if LLVM_VERSION_MAJOR >= 12
- llvm::LLVMContext& llvmCtx = module.getContext();
- return llvm::StructType::getTypeByName(llvmCtx, ResourceDimensionTypeName[resourceDimTypeId]);
+ return llvm::StructType::getTypeByName(module.getContext(), ResourceDimensionTypeName[resourceDimTypeId]);
#else
return module.getTypeByName(ResourceDimensionTypeName[resourceDimTypeId]);
#endif
}
-}
\ No newline at end of file
+}
--
2.17.1

View File

@ -0,0 +1,123 @@
From c6d333637537263930acb1b6c5dadb0467d745f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= <zboszor@pr.hu>
Date: Fri, 26 Feb 2021 06:39:35 +0100
Subject: [PATCH 3/3] Review fixes for LLVM 12 phase 2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Pending
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp | 4 ----
.../AddressSpaceAliasAnalysis.cpp | 10 +++++-----
.../PrivateMemory/PrivateMemoryResolution.cpp | 4 ----
IGC/DebugInfo/DebugInfoUtils.hpp | 4 ----
IGC/DebugInfo/DwarfDebug.cpp | 8 --------
5 files changed, 5 insertions(+), 25 deletions(-)
diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
index 12f42be8..c4f9d1ea 100644
--- a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
+++ b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
@@ -1576,11 +1576,7 @@ void SPIRVToLLVMDbgTran::transDbgInfo(SPIRVValue *SV, Value *V) {
Line->getColumn(), scope, iat);
if(scope && !isa<DIFile>(scope))
-#if LLVM_VERSION_MAJOR >= 12
I->setDebugLoc(DILocation::get(scope->getContext(), Line->getLine(), Line->getColumn(),
-#else
- I->setDebugLoc(DebugLoc::get(Line->getLine(), Line->getColumn(),
-#endif
scope, iat));
}
}
diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
index e9c07b34..b6b779da 100644
--- a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
+++ b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
@@ -23,8 +23,7 @@ IN THE SOFTWARE.
============================= end_copyright_notice ===========================*/
#include "llvm/Config/llvm-config.h"
-#include "llvmWrapper/IR/DerivedTypes.h"
-#include "llvmWrapper/Analysis/TargetLibraryInfo.h"
+#include <llvm/Analysis/TargetLibraryInfo.h>
#include "Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.h"
#include "Compiler/CodeGenPublic.h"
#include "Compiler/IGCPassSupport.h"
@@ -180,11 +179,12 @@ namespace {
bool doInitialization(Module& M) override {
if(M.size() > 0)
{
+ Result.reset(new AddressSpaceAAResult(
+ getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
#if LLVM_VERSION_MAJOR >= 10
- Function &F = *M.begin();
+ *M.begin()
#endif
- Result.reset(new AddressSpaceAAResult(
- getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(),
+ ),
*getAnalysis<CodeGenContextWrapper>().getCodeGenContext()));
}
return false;
diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
index 07f85f4c..98ea616f 100644
--- a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
+++ b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
@@ -816,11 +816,7 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
// Construct an empty DebugLoc.
IF_DEBUG_INFO(DebugLoc entryDebugLoc);
// Assign with the function location if available.
-#if LLVM_VERSION_MAJOR >= 12
IF_DEBUG_INFO_IF(DISubprogram *subprogram = m_currFunction->getSubprogram(), entryDebugLoc = DILocation::get(subprogram->getContext(), subprogram->getLine(), 0, subprogram););
-#else
- IF_DEBUG_INFO_IF(DISubprogram *subprogram = m_currFunction->getSubprogram(), entryDebugLoc = DebugLoc::get(subprogram->getLine(), 0, subprogram););
-#endif
IF_DEBUG_INFO(entryBuilder.SetCurrentDebugLocation(entryDebugLoc));
if (privateOnStack)
diff --git a/IGC/DebugInfo/DebugInfoUtils.hpp b/IGC/DebugInfo/DebugInfoUtils.hpp
index b77a550d..88b30a75 100644
--- a/IGC/DebugInfo/DebugInfoUtils.hpp
+++ b/IGC/DebugInfo/DebugInfoUtils.hpp
@@ -108,11 +108,7 @@ namespace IGC
IGCLLVM::DIBuilder Builder(M);
llvm::DIGlobalVariable* GV = GVs[j]->getVariable();
llvm::DIScope* scopeToUse = GV->getScope();
-#if LLVM_VERSION_MAJOR >= 12
llvm::DILocation* locToUse = llvm::DILocation::get(scopeToUse->getContext(), GV->getLine(), 0, scopeToUse, loc);
-#else
- llvm::DILocation* locToUse = llvm::DebugLoc::get(GV->getLine(), 0, scopeToUse, loc);
-#endif
if (llvm::isa<llvm::DICompileUnit>(GV->getScope()))
{
// Function has no DebugLoc so it is either internal
diff --git a/IGC/DebugInfo/DwarfDebug.cpp b/IGC/DebugInfo/DwarfDebug.cpp
index bd9f17b7..3d9f0835 100644
--- a/IGC/DebugInfo/DwarfDebug.cpp
+++ b/IGC/DebugInfo/DwarfDebug.cpp
@@ -2102,17 +2102,9 @@ static DebugLoc getFnDebugLoc(DebugLoc DL, const LLVMContext& Ctx)
// Check for number of operands since the compatibility is cheap here.
if (SP->getNumOperands() > 19)
{
-#if LLVM_VERSION_MAJOR >= 12
return DILocation::get(SP->getContext(), SP->getScopeLine(), 0, SP);
-#else
- return DebugLoc::get(SP->getScopeLine(), 0, SP);
-#endif
}
-#if LLVM_VERSION_MAJOR >= 12
return DILocation::get(SP->getContext(), SP->getLine(), 0, SP);
-#else
- return DebugLoc::get(SP->getLine(), 0, SP);
-#endif
}
return DebugLoc();
--
2.17.1

View File

@ -5,16 +5,19 @@ hardware architecture."
LICENSE = "MIT & BSD-3-Clause" LICENSE = "MIT & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://IGC/BiFModule/Implementation/ExternalLibraries/libclc/LICENSE.TXT;md5=311cfc1a5b54bab8ed34a0b5fba4373e \ LIC_FILES_CHKSUM = "file://IGC/BiFModule/Implementation/ExternalLibraries/libclc/LICENSE.TXT;md5=311cfc1a5b54bab8ed34a0b5fba4373e \
file://IGC/Compiler/LegalizationPass.cpp;beginline=1;endline=25;md5=4abf1738ff96b18e34186eb763e28eeb \ file://IGC/Compiler/LegalizationPass.cpp;beginline=1;endline=23;md5=8b19c5999abc484f18232b0905367f9f \
file://NOTICES.txt;md5=b12e73994de4fbe0f688cf0bc91512a0" file://NOTICES.txt;md5=b12e73994de4fbe0f688cf0bc91512a0"
SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https; \ SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https; \
file://0001-skip-execution-of-ElfPackager.patch \ file://0001-skip-execution-of-ElfPackager.patch \
file://link-to-LLVMGenXIntrinsics.patch \ file://link-to-LLVMGenXIntrinsics.patch \
file://improve_src_package_reproducibility.patch \ file://improve_src_package_reproducibility.patch \
file://0001-Fix-build-with-LLVM-12.patch \
file://0002-Review-fixes-for-LLVM-12-phase-1.patch \
file://0003-Review-fixes-for-LLVM-12-phase-2.patch \
" "
SRCREV = "f6ec355e7e275f87e0756576cd7a390d2365ed48" SRCREV = "535aaaef03ce338e05e6162118082e6e007e8c10"
# Used to replace with relative path in reproducibility patch # Used to replace with relative path in reproducibility patch
export B export B
@ -31,8 +34,7 @@ DEPENDS_append_class-target = " clang-cross-x86_64"
RDEPENDS_${PN} += "opencl-clang" RDEPENDS_${PN} += "opencl-clang"
LLVM_COMPAT_VERSION = "${@bb.utils.contains('LLVMVERSION', '10.0.1', '10.0.0', '11.1.0', d)}" 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_PREFERRED_LLVM_VERSION=${LLVM_COMPAT_VERSION} -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 -DINSTALL_SPIRVDLL=0 -DIGC_BUILD__VC_ENABLED=OFF"
BBCLASSEXTEND = "native nativesdk" BBCLASSEXTEND = "native nativesdk"