diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-08-12 15:36:52 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-21 09:36:38 -0400 |
commit | 293c7fba6cde31151baaf2a92c723605ed458ade (patch) | |
tree | f1ceb825c27bd10a8fc6c0becd9cfa346b421afb /compiler/GHC/CmmToAsm/X86/CodeGen.hs | |
parent | eb9bdaef6024558696e1e50b12d7fefb70483a9f (diff) | |
download | haskell-293c7fba6cde31151baaf2a92c723605ed458ade.tar.gz |
Put CFG weights into their own module (#17957)
It avoids having to query DynFlags to get them
Diffstat (limited to 'compiler/GHC/CmmToAsm/X86/CodeGen.hs')
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/CodeGen.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/CmmToAsm/X86/CodeGen.hs b/compiler/GHC/CmmToAsm/X86/CodeGen.hs index 51ee9ffce9..cbf3da9925 100644 --- a/compiler/GHC/CmmToAsm/X86/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/X86/CodeGen.hs @@ -57,6 +57,7 @@ import GHC.CmmToAsm.Monad , getDeltaNat, getBlockIdNat, getPicBaseNat, getNewRegPairNat , getPicBaseMaybeNat, getDebugBlock, getFileId , addImmediateSuccessorNat, updateCfgNat, getConfig, getPlatform + , getCfgWeights ) import GHC.CmmToAsm.CFG import GHC.CmmToAsm.Format @@ -2106,10 +2107,10 @@ genCCall is32Bit (PrimTarget (MO_Ctz width)) [dst] [src] bid -- bid -> lbl2 -- bid -> lbl1 -> lbl2 -- We also changes edges originating at bid to start at lbl2 instead. - dflags <- getDynFlags + weights <- getCfgWeights updateCfgNat (addWeightEdge bid lbl1 110 . addWeightEdge lbl1 lbl2 110 . - addImmediateSuccessor dflags bid lbl2) + addImmediateSuccessor weights bid lbl2) -- The following instruction sequence corresponds to the pseudo-code -- |