[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 03:21:54 PDT 2021


ebrevnov created this revision.
Herald added a subscriber: hiraditya.
ebrevnov requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add OR_None code to indicate that there is no overwrite. This has no any effect for current uses but will be used in one of the next patches building support for PHI translation.


Repository:
  rG LLVM Github Monorepo

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
 };
 
@@ -1055,7 +1056,7 @@
 
     // 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;
+    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.355168.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210629/12f88e4f/attachment.bin>


More information about the llvm-commits mailing list