From c6d333637537263930acb1b6c5dadb0467d745f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= 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 Signed-off-by: Naveen Saini --- 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(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 #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().getTLI( #if LLVM_VERSION_MAJOR >= 10 - Function &F = *M.begin(); + *M.begin() #endif - Result.reset(new AddressSpaceAAResult( - getAnalysis().getTLI(), + ), *getAnalysis().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(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