Skip to content

Commit c2db695

Browse files
committed
Add a TODO about isRemovable()
1 parent 1b8c278 commit c2db695

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,14 +2385,14 @@ DSEState::eliminateDeadDefs(const MemoryLocationWrapper &KillingLocWrapper) {
23852385
// We cannot apply the initializes attribute to DeadAccess/DeadDef.
23862386
// It would incorrectly consider a call instruction as redundant store
23872387
// and remove this call instruction.
2388+
// TODO: this conflates the existence of a MemoryLocation with being able
2389+
// to delete the instruction. Fix isRemovable() to consider calls with
2390+
// side effects that cannot be removed, e.g. calls with the initializes
2391+
// attribute, and remove getLocForInst(ConsiderInitializesAttr = false).
23882392
MemoryDefWrapper DeadDefWrapper(
23892393
cast<MemoryDef>(DeadAccess),
23902394
getLocForInst(cast<MemoryDef>(DeadAccess)->getMemoryInst(),
23912395
/*ConsiderInitializesAttr=*/false));
2392-
// Note that we don't consider the initializes attribute for DeadAccess.
2393-
// The dead access would be just a regular write access, like Store
2394-
// instruction, and its MemoryDefWrapper would only contain one
2395-
// MemoryLocationWrapper.
23962396
assert(DeadDefWrapper.DefinedLocations.size() == 1);
23972397
MemoryLocationWrapper &DeadLocWrapper =
23982398
DeadDefWrapper.DefinedLocations.front();

0 commit comments

Comments
 (0)