Skip to content

Use PrimOpIds cache more and optimize it slightly

Primop's Ids are created with mkPrimOpId :: PrimOp -> Id. To avoid doing useless work, we have a cache of all these Ids: primOpIds array in GHC.Builtin.Utils. Fetching an Id from the cache is done with primOpId :: PrimOp -> Id

  1. In a few places we use mkPrimOpId instead of primOpId. We should fix this.

  2. primOpIds is an Array with bounds checking and a card table. As the array is constant and always safely indexed, a SmallArray would be more efficient in time and space.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information