Skip to content

Commit

Permalink
Don't arity raise or unbox grinMain
Browse files Browse the repository at this point in the history
It never has arguments so this makes no difference
and these transforms mess with the name
  • Loading branch information
Z-snails committed May 24, 2021
1 parent 280dfeb commit 6de88bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions grin/src/Transformations/Optimising/ArityRaising.hs
Expand Up @@ -103,6 +103,7 @@ phase1 te = pdArityData . cata collect where
, isJust mtag
, p `notElem` (bdOther body)
, p `notElem` (snd <$> (filter ((/=fn) . fst) (bdFunCall body)))
, fn /= "grinMain"
]
in FunData $ case funData of
[] -> Map.empty
Expand Down
2 changes: 1 addition & 1 deletion grin/src/Transformations/Optimising/GeneralizedUnboxing.hs
Expand Up @@ -92,7 +92,7 @@ functionsToUnbox te (Program exts defs) = result where

nonCandidateTailCallMap = Map.withoutKeys tranisitiveTailCalls result0
candidateCalledByNonCandidate = (Set.unions $ Map.elems nonCandidateTailCallMap) `Set.intersection` result0
result = result0 `Set.difference` candidateCalledByNonCandidate
result = Set.delete "grinMain" $ result0 `Set.difference` candidateCalledByNonCandidate

result0 = Set.fromList $ step initial
initial = map funName $ filter (doesReturnAKnownProduct te . funName) defs
Expand Down

0 comments on commit 6de88bc

Please sign in to comment.