-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Hi!
I've made a simple frontend for GRIN and struggle with the optimizations.
- When running
stack exec grin -- --optimize --no-prelude --print-errors --continue-on-failed-lint dump.grin
for this I get a lot of
case has non-covered alternative CError
case has non-covered alternative CFalse
case has non-covered alternative CNode
case has non-covered alternative CNone
case has non-covered alternative CTrue
case has non-covered alternative CVal
....
which fails the linting and I guess it is the result of eval inlining and case alternatives removal, but I don't know why linting should fail then. And finally, I get my process killed on RunPure stage:
PHASE #3
PipelineStep: T BindNormalisation had effect: None (0.001100 ms)
PipelineStep: T SimpleDeadVariableElimination
Analysis
PipelineStep: Eff CalcEffectMap (0.000600 ms)
had effect: None (1.962300 ms)
PipelineStep: T NonSharedElimination
Analysis
PipelineStep: Sharing Compile (0.000800 ms)
PipelineStep: Sharing RunPure iterations: Killed
- When running
stack exec grin -- --optimize --no-prelude --print-errors --continue-on-failed-lint dump_2.grin
for this I get the same but the process gets killed on hpt stage:
PipelineStep: T SparseCaseOptimisation had effect: None (0.696800 ms)
PipelineStep: T CaseHoisting had effect: None (0.945100 ms)
PipelineStep: T GeneralizedUnboxing had effect: None (0.008400 ms)
PipelineStep: T ArityRaising had effect: None (0.040300 ms)
PipelineStep: T InlineApply had effect: None (1.803600 ms)
PipelineStep: T LateInlining Invalidating type environment
had effect: ExpChanged (12.713100 ms)
PipelineStep: SaveGrin (Rel "LateInlining.grin") (13.689900 ms)
PipelineStep: T BindNormalisation had effect: ExpChanged (0.001200 ms)
PipelineStep: SaveGrin (Rel "BindNormalisation.grin") (23.816600 ms)
PipelineStep: T InlineEval
Analysis
PipelineStep: HPT Compile (0.000400 ms)
PipelineStep: HPT RunPure iterations: 144 Killed
and sometimes I also have some type env errors after HPT.
So the question is whether it is supposed to be like this and are there a set of transformations/optimizations/workarounds that are guaranteed to proceed successfully and output simple enough GRIN to compile it into hardware?
P.S. both examples work fine in --eval
Metadata
Metadata
Assignees
Labels
No labels