Quantcast
Channel: GHC: Ticket #4962: Dead code fed to CorePrep because RULEs keep it alive spuriously
Viewing all articles
Browse latest Browse all 26

comment added

$
0
0

OK, here's a refined plan

  • In CorePrep.cloneBndr, drop all unfoldings or rules
  • In CorePrep.deFloatTop, which is the bit right at the end of CorePrep, do occurAnalyseExpr on the RHS of each top-level binding.

The second step will just drop local dead let-bindings which are the ones you want to drop. For that, it's fine for the top level Ids to be GlobalIds.

I think you are right that local bindings don't currently retain their RUES in CoreTidy, but I think that's ok. It would only matter in a function that was going to be inlined. But if it's small enough to be inlined, it's not going to be big enough to have interesting specialisations on local let-bindings.

The reason we keep INLINE unfoldings is that Roman does write INLINE pragmas whose RHS has a local binding with an INLINE pragma. If he wrote local bindings with RULEs I'd have to retract the previous para -- but we have no way to write RULES for local defns (yet)!

Do you feel like trying this out?

Simon


Viewing all articles
Browse latest Browse all 26

Trending Articles