Skip to content
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

Backwards analysis required for ForceDominance #1263

Open
skrynski opened this issue Jan 29, 2024 · 0 comments
Open

Backwards analysis required for ForceDominance #1263

skrynski opened this issue Jan 29, 2024 · 0 comments
Labels
bug pir to be solved in the compiler, the PIR, the optimizer (/compiler)

Comments

@skrynski
Copy link
Collaborator

skrynski commented Jan 29, 2024

At:

if (a.isUnused(mk)) {

To determine whether a promise is unused anywhere else and therefore can be lowered, a forward analysis does not suffice. See file attached. If a promise is not used 'so far' within a particular branch, it does not mean it is not used in any other branches and, therefore, is not necessarily a candidate.
FDGVN.txt

Notice that, in the file, the Deopt BB comes from a dead CheckPoint. Maybe we should schedule a Checkpoint cleanup at the very end of ForceDominance.

Also, we should revisit the method isUnused.

This is the only issue I did not solve when working on #1250. The bug is exposed when the budget is lifted from the pass scheduler. Sometimes ForceDominance and GVN will fight each other while doing and undoing changes, getting stuck in a loop. For example, ForceDominance would push MkArg instructions down to exit BBs, and GNU would push them back up.
To expose the bug, run : PIR_WARMUP=2 PIR_DEOPT_CHAOS=50000 bin/R -f ../../external/custom-r/tests/Examples/utils-Ex.R

@skrynski skrynski added bug pir to be solved in the compiler, the PIR, the optimizer (/compiler) labels Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pir to be solved in the compiler, the PIR, the optimizer (/compiler)
Projects
None yet
Development

No branches or pull requests

1 participant