X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FDriverPipeline.hs;fp=compiler%2Fmain%2FDriverPipeline.hs;h=a832034749e1731907c8510ae26cc8a1f980bdc2;hp=03e3cf6c565dd51d64cd715db24ffe9d8d3e622a;hb=50e0db459cb1b1341bbd527a3c450f0930e6ab43;hpb=22423fc93a008732e426f10f1b545b5d571173f3 diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 03e3cf6..a832034 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1307,22 +1307,18 @@ runPhase LlvmOpt input_fn dflags -- fix up some pretty big deficiencies in the code we generate llvmOpts = ["-mem2reg", "-O1", "-O2"] - ----------------------------------------------------------------------------- -- LlvmLlc phase runPhase LlvmLlc input_fn dflags = do let lc_opts = getOpts dflags opt_lc - let opt_lvl = max 0 (min 2 $ optLevel dflags) - let nphase = if cTargetOS == OSX - then LlvmMangle - else As - let rmodel | opt_PIC = "pic" + opt_lvl = max 0 (min 2 $ optLevel dflags) + rmodel | opt_PIC = "pic" | not opt_Static = "dynamic-no-pic" | otherwise = "static" - output_fn <- phaseOutputFilename nphase + output_fn <- phaseOutputFilename LlvmMangle io $ SysTools.runLlvmLlc dflags ([ SysTools.Option (llvmOpts !! opt_lvl), @@ -1331,13 +1327,13 @@ runPhase LlvmLlc input_fn dflags SysTools.Option "-o", SysTools.FileOption "" output_fn] ++ map SysTools.Option lc_opts) - return (nphase, output_fn) + return (LlvmMangle, output_fn) where + -- Bug in LLVM at O3 on OSX. llvmOpts = if cTargetOS == OSX then ["-O1", "-O2", "-O2"] else ["-O1", "-O2", "-O3"] - ----------------------------------------------------------------------------- -- LlvmMangle phase