HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.CmmToAsm.X86.Cond

  • 1 type
  • 3 values
  • Packageghc-9.10.3
  • Exports4
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceCond.hs
valuemaybeFlipCond :: Cond -> Maybe Cond
#

maybeFlipCond c returns Just c' if it is possible to flip the arguments to the conditional c, and the new condition should be c'.

If we apply maybeInvertCond to the condition of a jump we turn jumps taken into jumps not taken and vice versa.

Careful! If the used comparison and the conditional jump don't match the above behaviour will NOT hold. When used for FP comparisons this does not consider unordered numbers. Also inverting twice might return a synonym for the original condition.