[llvm] [DSE] Apply initializes attribute to DSE (PR #107282)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 4 15:19:11 PDT 2024
================
@@ -2232,8 +2366,11 @@ DSEState::eliminateDeadDefs(const MemoryLocationWrapper &KillingLocWrapper) {
}
MemoryDefWrapper DeadDefWrapper(
cast<MemoryDef>(DeadAccess),
- getLocForInst(cast<MemoryDef>(DeadAccess)->getMemoryInst()));
- MemoryLocationWrapper &DeadLocWrapper = *DeadDefWrapper.DefinedLocation;
+ getLocForInst(cast<MemoryDef>(DeadAccess)->getMemoryInst(),
+ /*ConsiderInitializesAttr=*/false));
+ assert(DeadDefWrapper.DefinedLocations.size() == 1);
+ MemoryLocationWrapper &DeadLocWrapper =
+ DeadDefWrapper.DefinedLocations.front();
----------------
aeubanks wrote:
I'm not 100% sure what's going on here, but it seems weird that we have two modes for `MemoryDefWrapper`, a single MemoryLocation version here and a multiple MemoryLocation below. is there any way to make this a little less hacked together? why does this have to be a single MemoryLocation?
https://github.com/llvm/llvm-project/pull/107282
More information about the llvm-commits
mailing list