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
-
In a few places we use
mkPrimOpId
instead ofprimOpId
. We should fix this. -
primOpIds
is anArray
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.