Skip to content

Commit 62b9323

Browse files
committed
[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.
1 parent 53e5723 commit 62b9323

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,10 +1818,8 @@ void StackAllocationPromoter::run() {
18181818
auto *si = it.second;
18191819
auto stored = si->getOperand(CopyLikeInstruction::Src);
18201820
valuesToComplete.push_back(stored);
1821-
if (lexicalLifetimeEnsured(asi)) {
1822-
if (auto lexical = getLexicalValueForStore(si, asi)) {
1823-
valuesToComplete.push_back(lexical);
1824-
}
1821+
if (auto lexical = getLexicalValueForStore(si, asi)) {
1822+
valuesToComplete.push_back(lexical);
18251823
}
18261824
}
18271825
}

0 commit comments

Comments
 (0)