
#11158: Combine exprIsTrivial and cpe_ExprIsTrivial -------------------------------------+------------------------------------- Reporter: simonpj | Owner: bgamari Type: task | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1656 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): When quickly reviewing Phab:D1656 in response to some validation issues I noticed that these `exprIsTrivial` variants differ slightly in their treatment of literals. While `CorePrep`'s `cpe_ExprIsTrivial` always considers `Lits` to be trivial, `CoreUtils`'s variant relies on `Literal.litIsTrivial` in this case. `litIsTrivial` deems all literals except `MachStr` and `LitIntegers` to be trivial. This effectively means that `cpeArg` will no longer consider these literals to be trivial, resulting in eta expansion of some expressions containing them which are currently left untouched. This is evidently problematic. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11158#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler