1 Description: Support LLVM 6
3 LLVMContext::setDiagnosticHandler is renamed
4 LoopInfo::markAsRemoved is partly replaced by LoopInfo::erase,
5 but that doesn't remove the loop from the queue
7 Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
8 Forwarded: https://lists.freedesktop.org/archives/beignet/2018-July/009211.html (original), https://lists.freedesktop.org/archives/beignet/2019-January/009222.html (#913141 fix)
10 --- a/backend/src/llvm/llvm_to_gen.cpp
11 +++ b/backend/src/llvm/llvm_to_gen.cpp
12 @@ -322,7 +322,11 @@ namespace gbe
15 gbeDiagnosticContext dc;
16 +#if LLVM_VERSION_MAJOR >= 6
17 + mod.getContext().setDiagnosticHandlerCallBack(&gbeDiagnosticHandler,&dc);
19 mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
22 #if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
23 mod.setDataLayout(DL);
24 --- a/backend/src/llvm/llvm_unroll.cpp
25 +++ b/backend/src/llvm/llvm_unroll.cpp
26 @@ -205,7 +205,10 @@ namespace gbe {
27 if (parentTripCount != 0 && currTripCount * parentTripCount > 32) {
28 //Don't change the unrollID if doesn't force unroll.
29 //setUnrollID(parentL, false);
30 -#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
31 +#if LLVM_VERSION_MAJOR >= 6
32 + LPM.markLoopAsDeleted(*parentL);
33 + loopInfo.erase(parentL);
34 +#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
35 loopInfo.markAsRemoved(parentL);
37 LPM.deleteLoopFromQueue(parentL);