Blame SOURCES/beignet-llvm6.patch

4c80fc
Description: Support LLVM 6
4c80fc
4c80fc
LLVMContext::setDiagnosticHandler and LoopInfo::markAsRemoved are renamed
4c80fc
4c80fc
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
4c80fc
Forwarded: <no|not-needed|url proving that it has been forwarded>
4c80fc
4c80fc
diff -uNr Beignet-1.3.2-Source.orig/backend/src/llvm/llvm_to_gen.cpp Beignet-1.3.2-Source/backend/src/llvm/llvm_to_gen.cpp
4c80fc
--- Beignet-1.3.2-Source.orig/backend/src/llvm/llvm_to_gen.cpp	2017-10-24 08:04:48.000000000 +0200
4c80fc
+++ Beignet-1.3.2-Source/backend/src/llvm/llvm_to_gen.cpp	2018-07-21 09:02:25.891056989 +0200
4c80fc
@@ -322,7 +322,11 @@
4c80fc
     DataLayout DL(&mod);
4c80fc
     
4c80fc
     gbeDiagnosticContext dc;
4c80fc
-    mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
4c80fc
+#if LLVM_VERSION_MAJOR >= 6
4c80fc
+    mod.getContext().setDiagnosticHandlerCallBack(&gbeDiagnosticHandler, &dc);
4c80fc
+#else
4c80fc
+    mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler, &dc);
4c80fc
+#endif
4c80fc
 
4c80fc
 #if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
4c80fc
     mod.setDataLayout(DL);
4c80fc
diff -uNr Beignet-1.3.2-Source.orig/backend/src/llvm/llvm_unroll.cpp Beignet-1.3.2-Source/backend/src/llvm/llvm_unroll.cpp
4c80fc
--- Beignet-1.3.2-Source.orig/backend/src/llvm/llvm_unroll.cpp	2017-10-24 08:04:48.000000000 +0200
4c80fc
+++ Beignet-1.3.2-Source/backend/src/llvm/llvm_unroll.cpp	2018-07-21 09:03:15.524362357 +0200
4c80fc
@@ -205,7 +205,9 @@
4c80fc
           if (parentTripCount != 0 && currTripCount * parentTripCount > 32) {
4c80fc
             //Don't change the unrollID if doesn't force unroll.
4c80fc
             //setUnrollID(parentL, false);
4c80fc
-#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
4c80fc
+#if LLVM_VERSION_MAJOR >= 6
4c80fc
+            loopInfo.erase(parentL);
4c80fc
+#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
4c80fc
             loopInfo.markAsRemoved(parentL);
4c80fc
 #else
4c80fc
             LPM.deleteLoopFromQueue(parentL);