[Mem2Reg] NFC: Removed duplicative check.

Because getLexicalValueForStore returns "null" when
lexicalLifetimeEnsured is false, there's no need to check first whether
lexicalLifetimeEnsured is true before calling getLexicalValueForStore
and only taking action if a non-"null" value is returned.
This commit is contained in:
Nate Chandler
2023-05-15 13:10:21 -07:00
parent 53e57230a4
commit 62b9323cde

View File

@@ -1818,10 +1818,8 @@ void StackAllocationPromoter::run() {
auto *si = it.second;
auto stored = si->getOperand(CopyLikeInstruction::Src);
valuesToComplete.push_back(stored);
if (lexicalLifetimeEnsured(asi)) {
if (auto lexical = getLexicalValueForStore(si, asi)) {
valuesToComplete.push_back(lexical);
}
if (auto lexical = getLexicalValueForStore(si, asi)) {
valuesToComplete.push_back(lexical);
}
}
}