File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments