[PATCH] D105098: [DSE][NFC] Introduce "doesn't overwrite" return code for isOverwrite
Evgeniy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 29 05:48:03 PDT 2021
ebrevnov updated this revision to Diff 355191.
ebrevnov added a comment.
Minor update
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105098/new/
https://reviews.llvm.org/D105098
Files:
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -327,6 +327,7 @@
OW_End,
OW_PartialEarlierWithFullLater,
OW_MaybePartial,
+ OW_None,
OW_Unknown
};
@@ -941,7 +942,8 @@
/// Return OW_MaybePartial if \p Later does not completely overwrite
/// \p Earlier, but they both write to the same underlying object. In that
/// case, use isPartialOverwrite to check if \p Later partially overwrites
- /// \p Earlier. Returns 'OW_Unknown' if nothing can be determined.
+ /// \p Earlier. Returns 'OR_None' if later is known to not overwrite the
+ /// earlier. 'OW_Unknown' if nothing can be determined.
OverwriteResult
isOverwrite(const Instruction *LaterI, const Instruction *EarlierI,
const MemoryLocation &Later, const MemoryLocation &Earlier,
@@ -1053,9 +1055,8 @@
return OW_MaybePartial;
}
- // Can reach here only if accesses are known not to overlap. There is no
- // dedicated code to indicate no overlap so signal "unknown".
- return OW_Unknown;
+ // Can reach here only if accesses are known not to overlap.
+ return OW_None;
}
bool isInvisibleToCallerAfterRet(const Value *V) {
@@ -1455,7 +1456,7 @@
DepWriteOffset, InstWriteOffset);
// If Current does not write to the same object as KillingDef, check
// the next candidate.
- if (OR == OW_Unknown)
+ if (OR == OW_Unknown || OR == OW_None)
continue;
else if (OR == OW_MaybePartial) {
// If KillingDef only partially overwrites Current, check the next
@@ -1464,6 +1465,7 @@
// which are less likely to be removable in the end.
if (PartialLimit <= 1) {
WalkerStepLimit -= 1;
+ LLVM_DEBUG(dbgs() << " ... reached partial limit ... continue with next access\n");
continue;
}
PartialLimit -= 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105098.355191.patch
Type: text/x-patch
Size: 2094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210629/37fc90fd/attachment.bin>
More information about the llvm-commits
mailing list