Skip to content

Inliner optimization fixups #5

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

Merged

Conversation

anton-bannykh
Copy link

Part of KT-69697 Native: LLVM inliner optimization might have brought new bugs

Cherry-picked fixups mentioned in llvm#94815

After llvm#94815, this is only used within
ModuleToPostOrderCGSCCPassAdaptor::run(), so keep it local to that
function.

(cherry picked from commit b312cbf)
The passed SCC is the current SCC we're working on.

(cherry picked from commit 0555afd)
Rather than doing delta counting of the total number of functions, just
increment it when we see a new function.

(cherry picked from commit 81f4fb6)
As opposed to using Node::isDead(), which is no longer accurate after

This is only used in diagnostics.

(cherry picked from commit ebdb6f4)
With llvm#94815, the nodes belonging to dead functions are no longer
invalidated, but kept around to batch delete at the end of the call
graph walk.

The ML inliner needs to be updated to handle this. This fixes some
asserts getting hit, e.g. https://crbug.com/348376263.

(cherry picked from commit 94471e6)
The RefSCC that a function marked dead is in may still contain valid
SCCs that we want to visit. We rely on InvalidatedSCCs to skip SCCs
containing dead functions.

The addition of RefSCCs in CallGraphUpdater to InvalidatedRefSCCs was
causing asserts as reported in llvm#94815. Fix some more CallGraphUpdater
function deletion methods as well.

(cherry picked from commit 8d800e6)
@anton-bannykh anton-bannykh merged commit 8d568c9 into kotlin/llvm-16.0.0 Aug 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants