diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-04-13 15:57:50 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-04-14 11:53:41 +0900 |
commit | 171a570f388b2895d14f6d5418c99573cffd6369 (patch) | |
tree | 004311a5ae27e96cb488b799849702a502515582 /src/gallium | |
parent | b63a98b1211d22f759ae9c80b2270fe2d3b2639e (diff) | |
download | external_mesa3d-171a570f388b2895d14f6d5418c99573cffd6369.zip external_mesa3d-171a570f388b2895d14f6d5418c99573cffd6369.tar.gz external_mesa3d-171a570f388b2895d14f6d5418c99573cffd6369.tar.bz2 |
clover: Fix build against LLVM SVN >= r266163
createInternalizePass now takes a callback instead of a StringSet.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/invocation.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 4d11c24..fb75788 100644 --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp @@ -322,6 +322,15 @@ namespace { // list of kernel functions to the internalizer. The internalizer will // treat the functions in the list as "main" functions and internalize // all of the other functions. +#if HAVE_LLVM >= 0x0309 + auto preserve_kernels = [=](const llvm::GlobalValue &GV) { + for (const auto &kernel : kernels) { + if (GV.getName() == kernel->getName()) + return true; + } + return false; + }; +#else std::vector<const char*> export_list; for (std::vector<llvm::Function *>::const_iterator I = kernels.begin(), E = kernels.end(); @@ -329,12 +338,17 @@ namespace { llvm::Function *kernel = *I; export_list.push_back(kernel->getName().data()); } +#endif #if HAVE_LLVM < 0x0306 PM.add(new llvm::DataLayoutPass(mod)); #elif HAVE_LLVM < 0x0307 PM.add(new llvm::DataLayoutPass()); #endif +#if HAVE_LLVM >= 0x0309 + PM.add(llvm::createInternalizePass(preserve_kernels)); +#else PM.add(llvm::createInternalizePass(export_list)); +#endif llvm::PassManagerBuilder PMB; PMB.OptLevel = optimization_level; |