Skip to content

Commit f660110

Browse files
committed
Fix a mistake in getLocForInst: add getLocForWith no matter ConsiderInitializesAttr is true or false
1 parent 72dcab3 commit f660110

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,15 +1275,14 @@ struct DSEState {
12751275
return Locations;
12761276
}
12771277

1278+
if (auto Loc = getLocForWrite(I))
1279+
Locations.push_back(std::make_pair(*Loc, false));
1280+
12781281
if (ConsiderInitializesAttr) {
12791282
for (auto &MemLoc : getInitializesArgMemLoc(I, BatchAA)) {
12801283
Locations.push_back(std::make_pair(MemLoc, true));
12811284
}
1282-
return Locations;
12831285
}
1284-
1285-
if (auto Loc = getLocForWrite(I))
1286-
Locations.push_back(std::make_pair(*Loc, false));
12871286
return Locations;
12881287
}
12891288

0 commit comments

Comments
 (0)