Skip to content

Commit 7aab12e

Browse files
committed
[DSE] Only query object size for identified objects
This is supposed to be a fast heuristic primarily interested in allocas. We should not call it for non-root objects where object size needs to be determined recursively.
1 parent 913286b commit 7aab12e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ struct DSEState {
949949

950950
// Check whether the killing store overwrites the whole object, in which
951951
// case the size/offset of the dead store does not matter.
952-
if (DeadUndObj == KillingUndObj && KillingLocSize.isPrecise()) {
952+
if (DeadUndObj == KillingUndObj && KillingLocSize.isPrecise() &&
953+
isIdentifiedObject(KillingUndObj)) {
953954
uint64_t KillingUndObjSize = getPointerSize(KillingUndObj, DL, TLI, &F);
954955
if (KillingUndObjSize != MemoryLocation::UnknownSize &&
955956
KillingUndObjSize == KillingLocSize.getValue())

0 commit comments

Comments
 (0)