diff options
author | Alexander Biehl <alexbiehl@gmail.com> | 2018-01-18 13:21:02 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-01-29 18:23:41 -0500 |
commit | 96d2eb27eb86540796944253ce47b2bcd6a2df1c (patch) | |
tree | a7160b4681c77bccd1213b8837b18a2c9f23e77d | |
parent | 1cb12eae648c964c411f4c83730f3db05e409f48 (diff) | |
download | haskell-96d2eb27eb86540796944253ce47b2bcd6a2df1c.tar.gz |
Invert likeliness when improving conditionals
... in CmmSink
-rw-r--r-- | compiler/cmm/CmmSink.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/cmm/CmmSink.hs b/compiler/cmm/CmmSink.hs index 3633ed3003..76ce18b534 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 |