Commit afdb2fc3 authored by gmainlan@microsoft.com's avatar gmainlan@microsoft.com
Browse files

Set LLVM option -stack-alignment=32 when compiling AVX instructions.

parent e074c1c2
......@@ -1381,7 +1381,8 @@ runPhase (RealPhase LlvmLlc) input_fn dflags
++ map SysTools.Option fpOpts
++ map SysTools.Option abiOpts
++ map SysTools.Option sseOpts
++ map SysTools.Option avxOpts)
++ map SysTools.Option avxOpts
++ map SysTools.Option stackAlignOpts)
return (RealPhase next_phase, output_fn)
where
......@@ -1418,6 +1419,11 @@ runPhase (RealPhase LlvmLlc) input_fn dflags
| isAvxEnabled dflags = ["-mattr=+avx"]
| otherwise = []
stackAlignOpts =
case platformArch (targetPlatform dflags) of
ArchX86_64 | isAvxEnabled dflags -> ["-stack-alignment=32"]
_ -> []
-----------------------------------------------------------------------------
-- LlvmMangle phase
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment