Skip to content
Snippets Groups Projects
Commit fded7dd4 authored by Sebastian Graf's avatar Sebastian Graf Committed by Marge Bot
Browse files

CorePrep: Allow floating dictionary applications in -O0 into a Rec (#24102)

parent a4b2ec47
No related branches found
No related tags found
No related merge requests found
......@@ -643,13 +643,20 @@ cpeBind top_lvl env (Rec pairs)
where
(bndrs, rhss) = unzip pairs
-- Flatten all the floats, and the current
-- group into a single giant Rec
-- Flatten all the floats, and the current
-- group into a single giant Rec
add_float (Float bind bound _) prs2
| bound /= CaseBound = case bind of
| bound /= CaseBound
|| all (definitelyLiftedType . idType) (bindersOf bind)
-- The latter check is hit in -O0 (i.e., flavours quick, devel2)
-- for dictionary args which haven't been floated out yet, #24102.
-- They are preferably CaseBound, but since they are lifted we may
-- just as well put them in the Rec, in contrast to lifted bindings.
= case bind of
NonRec x e -> (x,e) : prs2
Rec prs1 -> prs1 ++ prs2
add_float f _ = pprPanic "cpeBind" (ppr f)
add_float f _ = pprPanic "cpeBind" (ppr f)
---------------
cpePair :: TopLevelFlag -> RecFlag -> Demand -> Bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment