beignet-1.3.2-llvm6-support.patch 1.5 KB

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