Skip to content

Commit c7a59c3

Browse files
authored
Merge pull request #15487 from gottesmm/pr-aa03a816e41fb717e7cd9953015b077ec25eecc3
2 parents 8d9dfa4 + ddb88c9 commit c7a59c3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/SILOptimizer/IPO/GlobalOpt.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -910,16 +910,14 @@ void SILGlobalOpt::collectGlobalAccess(GlobalAddrInst *GAI) {
910910
if (!SILG->getDecl())
911911
return;
912912

913-
SILValue V = GAI;
914-
for (auto Use : getNonDebugUses(V)) {
915-
916-
if (auto *SI = dyn_cast<StoreInst>(Use->getUser())) {
913+
for (auto *Op : getNonDebugUses(GAI)) {
914+
if (auto *SI = dyn_cast<StoreInst>(Op->getUser())) {
917915
if (SI->getDest() == GAI)
918916
collectGlobalStore(SI, SILG);
919917
continue;
920918
}
921919

922-
if (auto *Load = getValidLoad(Use->getUser(), GAI)) {
920+
if (auto *Load = getValidLoad(Op->getUser(), GAI)) {
923921
collectGlobalLoad(Load, SILG);
924922
continue;
925923
}

0 commit comments

Comments
 (0)