Skip to content

Drop redundant evals

Simon Peyton Jones requested to merge wip/T24251a into master

Addresses #24639.

Related to #24251 (closed), where we stopped discarding evals. I found that I was now not dropping a redundant eval in cases like

f xs = xs `seq`
       (let t = blah in
        case xs of
          [] ->  (t,True)
          (_:_) -> (t,False))

(And sometimes the t might be a join point.)

Case-merge was intended to catch this, but the let/join gets in the way, so I added a few lines to CSE to do the job.

See Note [Eliminating redundant cases]

Edited by Simon Peyton Jones

Merge request reports