mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user