Mesa (master): gallivm: Disable frame-pointer-omission on x86 to ensure right stack alignment.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Mon Nov 3 14:47:31 UTC 2014
Module: Mesa
Branch: master
Commit: bfd453f94256a674194bc5f273db2260821c6c18
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bfd453f94256a674194bc5f273db2260821c6c18
Author: José Fonseca <jfonseca at vmware.com>
Date: Fri Oct 31 22:58:52 2014 +0000
gallivm: Disable frame-pointer-omission on x86 to ensure right stack alignment.
Between release 3.2 and 3.3 LLVM stopped aligning properly when certain
conditions (no allocas, but large number of vectors causing spills to
the stack, and frame pointer omission enabled).
We were already disabling frame-pointer-omission on several build types,
but we now disable it on all build types.
It's not clear whether this affects 32-bits x86 processes only, or if it
can also affect 64-bits x86_64 processes when AVX registers are
available and used. So disable frame-pointer-omission on both
x86/x86_64 to be on the safe side.
See also:
- http://llvm.org/PR21435
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
---
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 6bc4d81..fe3c754 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -433,7 +433,9 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
options.JITEmitDebugInfo = true;
#endif
-#if defined(DEBUG) || defined(PROFILE)
+ /* XXX: Workaround http://llvm.org/PR21435 */
+#if defined(DEBUG) || defined(PROFILE) || \
+ (HAVE_LLVM >= 0x0303 && (defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)))
#if HAVE_LLVM < 0x0304
options.NoFramePointerElimNonLeaf = true;
#endif
More information about the mesa-commit
mailing list