-
Couldn't load subscription status.
- Fork 15k
[InstCombine] Improve foldDeadPhiWeb compile time
#158057
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,15 +62,15 @@ bool InstCombinerImpl::foldDeadPhiWeb(PHINode &PN) { | |
| Stack.push_back(&PN); | ||
| while (!Stack.empty()) { | ||
| PHINode *Phi = Stack.pop_back_val(); | ||
| if (!Visited.insert(Phi).second) | ||
| continue; | ||
| // Early stop if the set of PHIs is large | ||
| if (Visited.size() == 16) | ||
| return false; | ||
| for (User *Use : Phi->users()) { | ||
| if (PHINode *PhiUse = dyn_cast<PHINode>(Use)) | ||
| if (PHINode *PhiUse = dyn_cast<PHINode>(Use)) { | ||
| if (!Visited.insert(Phi).second) | ||
|
||
| continue; | ||
| // Early stop if the set of PHIs is large | ||
| if (Visited.size() >= 16) | ||
| return false; | ||
| Stack.push_back(PhiUse); | ||
| else | ||
| } else | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add the initial phi node to the Visited set.