Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af497d9

Browse files
authored
[DSE] Simpily if condition (NFC) (#137777)
Note that the key-value pair has already been initialized, so assignment is not necessary.
1 parent 4bf93c0 commit af497d9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -1210,14 +1210,10 @@ struct DSEState {
12101210
bool isInvisibleToCallerAfterRet(const Value *V) {
12111211
if (isa<AllocaInst>(V))
12121212
return true;
1213+
12131214
auto I = InvisibleToCallerAfterRet.insert({V, false});
1214-
if (I.second) {
1215-
if (!isInvisibleToCallerOnUnwind(V)) {
1216-
I.first->second = false;
1217-
} else if (isNoAliasCall(V)) {
1218-
I.first->second = !PointerMayBeCaptured(V, /*ReturnCaptures=*/true);
1219-
}
1220-
}
1215+
if (I.second && isInvisibleToCallerOnUnwind(V) && isNoAliasCall(V))
1216+
I.first->second = !PointerMayBeCaptured(V, /*ReturnCaptures=*/true);
12211217
return I.first->second;
12221218
}
12231219

0 commit comments

Comments
 (0)