-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC] Improve OnceReduction comment #6068
Conversation
Are you proposing; "we can still remove the condition, if the once function does more than calling another once function"? |
Yes, exactly. Concretely: (func $once
(if
(global.get $once)
(return)
)
(global.set $once (i32.const 1))
;; Call another once function. This lets us remove the if and global.set.
(call $once.1)
;; Do other stuff. This does not stop us, since this PR.
(call $anything)
) |
if |
Oh right... how silly of me! I'll update this PR to fix the proof text and remove the change. |
This PR now only adds a comment to explain why we can only optimize in the case that we do. |
This weird ASan error seems like a random flake... it happens once every few PRs now. Very strange. I wish we had a way to ssh into the CI here to investigate... |
Followup to #6061 in which we only optimized the case of a "once" function immediately
calling another and doing nothing else. It is ok to do more things afterwards, so long as
we do nothing else before, by the same logic as already mentioned in the pass (but
clarified as to the meaning of "called" - all we need is for the function to have been
"entered" in the proof there, IIANM).
@gkdn am I missing something?