Add LLVM 6.0 support

Submitted by Rebecca N. Palmer on July 21, 2018, 7:04 p.m.

Details

Message ID b66109cd-76a2-299d-e13d-8300d392199e@zoho.com
State New
Headers show
Series "Add LLVM 6.0 support" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Rebecca N. Palmer July 21, 2018, 7:04 p.m.
LLVMContext::setDiagnosticHandler and LoopInfo::markAsRemoved
have been renamed.

Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com>

Patch hide | download patch | download mbox

--- a/backend/src/llvm/llvm_to_gen.cpp
+++ b/backend/src/llvm/llvm_to_gen.cpp
@@ -322,7 +322,11 @@  namespace gbe
     DataLayout DL(&mod);
     
     gbeDiagnosticContext dc;
+#if LLVM_VERSION_MAJOR >= 6
+    mod.getContext().setDiagnosticHandlerCallBack(&gbeDiagnosticHandler,&dc);
+#else
     mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
+#endif
 
 #if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
     mod.setDataLayout(DL);
--- a/backend/src/llvm/llvm_unroll.cpp
+++ b/backend/src/llvm/llvm_unroll.cpp
@@ -205,7 +205,9 @@  namespace gbe {
           if (parentTripCount != 0 && currTripCount * parentTripCount > 32) {
             //Don't change the unrollID if doesn't force unroll.
             //setUnrollID(parentL, false);
-#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
+#if LLVM_VERSION_MAJOR >= 6
+            loopInfo.erase(parentL);
+#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
             loopInfo.markAsRemoved(parentL);
 #else
             LPM.deleteLoopFromQueue(parentL);