mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
ExitSSA: don't exclude PHINodes with non-phi Users
Before this commit, the code never put in the same group two PHINodes if one of them had a non-phi User. This condition was wrong and was unnecessarily preventing valig PHINodes to be put in the same group. This caused the generation of a lot more local variables than necessary.
This commit is contained in:
@@ -122,12 +122,6 @@ static std::vector<SetVector<PHINode *>> getPHIEquivalenceClasses(Function &F) {
|
||||
if (PHISameVariableClasses.isEquivalent(&PHI, PHIUser))
|
||||
continue;
|
||||
|
||||
// If the PHI has a user that is not another PHI, it cannot be put in
|
||||
// the same equivalence class as the PHIUser, so we bail out.
|
||||
if (llvm::any_of(PHI.users(),
|
||||
[](const User *U) { return not isa<PHINode>(U); }))
|
||||
continue;
|
||||
|
||||
PHINode *PHILeader = PHISameVariableClasses.getLeaderValue(&PHI);
|
||||
PHINode *UserLeader = PHISameVariableClasses.getLeaderValue(PHIUser);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user