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:
Pietro Fezzardi
2026-06-16 17:11:07 +02:00
parent 422319f4d8
commit a7d4a73d2d
-6
View File
@@ -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);