Draft: add support for conditional assignment (branchless code) (fix #19448)

Open Sylvain Henry requested to merge hsyl20/ghc:hsyl20/cmm-cond-assign into master

This MR adds support for branchless assignments in Cmm and in the X86 ncg backend. Fix #19448.

  • Pass testsuite
  • Benchmark performance impact of the change: ~15% performance improvement in a benchmark)
  • Write a note: see Note[Conditional assignments] in GHC.StgToCmm.Expr
  • Add support for DataAlt. E.g.
foo :: Bool -> Int
foo x = case x of
  True -> 10
  False -> 27
  • Add testcase for DataAlt case
  • Fix #21710 or avoid using DataToTagOp in DataAlt case
Edited by Sylvain Henry

Merge request reports