[commit: ghc] master: Invert likeliness when improving conditionals (96d2eb2)

git at git.haskell.org git at git.haskell.org
Tue Jan 30 18:48:51 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/96d2eb27eb86540796944253ce47b2bcd6a2df1c/ghc

>---------------------------------------------------------------

commit 96d2eb27eb86540796944253ce47b2bcd6a2df1c
Author: Alexander Biehl <alexbiehl at gmail.com>
Date:   Thu Jan 18 13:21:02 2018 +0100

    Invert likeliness when improving conditionals
    
    ... in CmmSink


>---------------------------------------------------------------

96d2eb27eb86540796944253ce47b2bcd6a2df1c
 compiler/cmm/CmmSink.hs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compiler/cmm/CmmSink.hs b/compiler/cmm/CmmSink.hs
index 3633ed3..76ce18b 100644
--- a/compiler/cmm/CmmSink.hs
+++ b/compiler/cmm/CmmSink.hs
@@ -462,9 +462,13 @@ tryToInline dflags live node assigs = go usages node emptyLRegSet assigs
                      CmmCondBranch (CmmMachOp (MO_Ne w) args)
                                    ti fi l
                            -> CmmCondBranch (cmmMachOpFold dflags (MO_Eq w) args)
-                                            fi ti l
+                                            fi ti (inv_likeliness l)
                      node' -> node'
 
+        inv_likeliness :: Maybe Bool -> Maybe Bool
+        inv_likeliness Nothing  = Nothing
+        inv_likeliness (Just l) = Just (not l)
+
         inl_exp :: CmmExpr -> CmmExpr
         -- inl_exp is where the inlining actually takes place!
         inl_exp (CmmReg    (CmmLocal l'))     | l == l' = rhs



More information about the ghc-commits mailing list