gallivm: Disable frame pointer omission on LLVM 3.7.
authorJose Fonseca <jfonseca@vmware.com>
Thu, 28 May 2015 14:35:14 +0000 (15:35 +0100)
committerJose Fonseca <jfonseca@vmware.com>
Fri, 29 May 2015 10:20:58 +0000 (11:20 +0100)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_init.c

index 7b906c27ed5c2851a5906db3dd6067df198238d1..384ea8640815deb297b773ced762e62450f4a29d 100644 (file)
@@ -533,6 +533,16 @@ gallivm_compile_module(struct gallivm_state *gallivm)
       if (0) {
          debug_printf("optimizing func %s...\n", LLVMGetValueName(func));
       }
+
+   /* Disable frame pointer omission on debug/profile builds */
+   /* XXX: And workaround http://llvm.org/PR21435 */
+#if HAVE_LLVM >= 0x0307 && \
+    (defined(DEBUG) || defined(PROFILE) || \
+     defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
+      LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim", "true");
+      LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim-non-leaf", "true");
+#endif
+
       LLVMRunFunctionPassManager(gallivm->passmgr, func);
       func = LLVMGetNextFunction(func);
    }