mirror of
git://git.yoctoproject.org/meta-intel.git
synced 2025-07-19 21:09:03 +02:00

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>
124 lines
5.7 KiB
Diff
124 lines
5.7 KiB
Diff
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
|
|
|