Deforestation with nofibs in the Benchmark Sub-project#335
Open
ychenfo wants to merge 405 commits intohkust-taco:hkmc2from
Open
Deforestation with nofibs in the Benchmark Sub-project#335ychenfo wants to merge 405 commits intohkust-taco:hkmc2from
nofibs in the Benchmark Sub-project#335ychenfo wants to merge 405 commits intohkust-taco:hkmc2from
Conversation
…ges to avoid creating needless matchRest functions
LPTK
reviewed
Sep 19, 2025
| def rewriteOneBlk(b: Block) = b match | ||
| case Assign(lhs, Value.Lam(params, body), rest) if !lhs.isInstanceOf[TempSymbol] => | ||
| val newSym = BlockMemberSymbol(lhs.nme, Nil, | ||
| val newSym = BlockMemberSymbol(lhs.nme, syntax.Tree.DummyTermDef(syntax.Fun) :: Nil, |
LPTK
reviewed
Sep 19, 2025
| val sym = BlockMemberSymbol("lambda", Nil, nameIsMeaningful = false) | ||
| val sym = BlockMemberSymbol( | ||
| "lambda", | ||
| syntax.Tree.DummyTermDef(syntax.Fun) :: Nil, |
LPTK
reviewed
Sep 19, 2025
| case _ => N | ||
| val singleCallBms = BlockMemberSymbol(d.sym.nme + "$", Nil) | ||
LPTK
reviewed
Sep 19, 2025
Comment on lines
314
to
316
| args(fs): args => | ||
| val tmpSym = TempSymbol(N, "arr") | ||
| Assign(tmpSym, Value.Arr(mut = false, args), k(Value.Ref(tmpSym))) |
Contributor
There was a problem hiding this comment.
Is this really needed? At the very least, we shouldn't do it when the array is immediately returned or already assigned to a variable.
AnsonYeung
reviewed
Oct 6, 2025
Comment on lines
+516
to
+519
| fun insertCompact(mif_s, ls) = if mif_s is [mif, s] then | ||
| fun insert(x, ls) = if ls is | ||
| Nil then x :: Nil | ||
| y :: ys then if x > y then y :: insert(x, ys) else x :: y :: ys |
There was a problem hiding this comment.
Here x > y converts both x and y (which are JS objects of class MoveInFull) to string and perform string comparison. It should compare field by field instead
Contributor
There was a problem hiding this comment.
Thanks for the catch. @ychenfo let's remember to fix this when we come back to the PR.
gok99
reviewed
Oct 20, 2025
| open Benchmark | ||
|
|
||
|
|
||
| :silent |
There was a problem hiding this comment.
I'd forgotten to fix this in my PR, but these :silents could be moved to a single one in the header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO
nofibsto the benchmark subproject