Skip to content

Make `seq#` a magic Id and inline it in CorePrep (#24124)

Sebastian Graf requested to merge wip/T24124 into master

We can save much code and explanation in Tag Inference and StgToCmm by making seq# a known-key Magic Id in GHC.Internal.IO and inline this definition in CorePrep. See the updated Note [seq# magic]. I also implemented a new Note [Flatten case-bind] to get better code for otherwise nested case scrutinees.

I renamed the contructors of ArgInfo to use an AI prefix in order to resolve the clash between type CpeApp = CoreExpr and the data constructor of ArgInfo, as well as fixed typos in Note [CorePrep invariants].

Fixes #24252 (closed) and #24124 (closed).

Also !9874 currently regresses T15226 because there we get a stupid seq# (I# (x +# 3#)) which CorePrep does not eliminate. With this patch, all allocation should vanish.

Edited by Sebastian Graf

Merge request reports