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

PR for llvm/llvm-project#71637 #769

Merged
merged 1 commit into from
Nov 14, 2023
Merged

PR for llvm/llvm-project#71637 #769

merged 1 commit into from
Nov 14, 2023

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Nov 8, 2023

The hasAddressTaken() call in hasOnlyColdCalls() has quadratic
complexity if there are many cold calls to a function: We're going to
visit each call of the function, and then for each of them iterate all
the users of the function.

We've recently encountered a case where GlobalOpt spends more than an
hour in these hasAddressTaken() checks when full LTO is used.

Avoid this by moving the hasAddressTaken() check into hasChangeableCC()
and caching its result, so it is only computed once per function.

(cherry picked from commit e360a16fee2dc3cb632ace556fb715832f488a90)
@tru
Copy link
Contributor

tru commented Nov 13, 2023

@aeubanks ok to backport?

@aeubanks
Copy link
Contributor

lgtm

@tru tru merged commit 12c6ee8 into release/17.x Nov 14, 2023
14 of 15 checks passed
@tru tru deleted the llvm-issue71637 branch November 14, 2023 08:22
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.

Backport GlobalOpt compile-time fix
4 participants