Skip to content

Eliminate unsafeEqualityProof in GHC.CoreToStg.Prep

Simon Peyton Jones requested to merge wip/T19700 into master

The main idea here is to avoid treating

  • case e of {}
  • case unsafeEqualityProof of UnsafeRefl co -> blah

specially in CoreToStg. Instead, nail them in CorePrep, by converting

   case e of {}
     ==>   e |> unsafe-co

   case unsafeEqualityProof of UnsafeRefl co -> blah
     ==> let co = unsafe-co in blah

in GHC.Core.Prep. Now expressions that we want to treat as trivial really are trivial. We can get rid of cpExprIsTrivial. And we fix #19700 (closed).

This needs better documentation in the code. But let's check CI first.

Edited by Simon Peyton Jones

Merge request reports