diff options
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index 4f3e69681..3efa1d911 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -350,7 +350,7 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, * friends for configuring code generation options, like stack alignment. */ TargetOptions options; -#if defined(PIPE_ARCH_X86) +#if defined(PIPE_ARCH_X86) && LLVM_VERSION_MAJOR < 13 options.StackAlignmentOverride = 4; #endif @@ -596,3 +596,12 @@ lp_is_function(LLVMValueRef v) { return LLVMGetValueKind(v) == LLVMFunctionValueKind; } + +extern "C" void +lp_set_module_stack_alignment_override(LLVMModuleRef MRef, unsigned align) +{ +#if LLVM_VERSION_MAJOR >= 13 + llvm::Module *M = llvm::unwrap(MRef); + M->setOverrideStackAlignment(align); +#endif +} |