summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Review-fixes-for-LLVM-12-phase-2.patch
blob: 189c2b3f473d17f402c9c5e13e10d8057c3f7cd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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