[commit: ghc] wip/simd: Set LLVM option -stack-alignment=32 when compiling AVX instructions. (afdb2fc)
git at git.haskell.org
git at git.haskell.org
Mon Sep 23 06:12:32 CEST 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/simd
Link : http://ghc.haskell.org/trac/ghc/changeset/afdb2fc3d2013ced6c136853f4e24e84b6f150e9/ghc
>---------------------------------------------------------------
commit afdb2fc3d2013ced6c136853f4e24e84b6f150e9
Author: Geoffrey Mainland <gmainlan at microsoft.com>
Date: Thu Feb 14 21:25:54 2013 +0000
Set LLVM option -stack-alignment=32 when compiling AVX instructions.
>---------------------------------------------------------------
afdb2fc3d2013ced6c136853f4e24e84b6f150e9
compiler/main/DriverPipeline.hs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index a123564..76f6186 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -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
More information about the ghc-commits
mailing list