+ if (HAVE_LLVM >= 0x0400) {
+ /*
+ * Workaround for bug in llvm 4.0 that causes image intrinsics
+ * to disappear.
+ * https://reviews.llvm.org/D26348
+ */
+ const char *argv[2] = {"mesa", "-simplifycfg-sink-common=false"};
+ LLVMParseCommandLineOptions(2, argv, NULL);
+ }