[PATCH] D107812: [NFC][DSE] Clean up KnownNoReads and MemorySSAScanLimit in DSE

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 10 04:09:20 PDT 2021


yurai007 created this revision.
yurai007 added reviewers: fhahn, xbolva00, nikic, xgupta.
Herald added subscribers: asbirlea, george.burgess.iv, hiraditya.
yurai007 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Another simple cleanups set in DSE. CheckCache is removed since 1f1145006b32 <https://reviews.llvm.org/rG1f1145006b32533484c9ebc0f45e241a02fe6c8b> and in consequence KnownNoReads is useless.
Also updated description of MemorySSAScanLimit which default value is 150 instead 100.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107812

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
@@ -124,7 +124,7 @@
 static cl::opt<unsigned>
     MemorySSAScanLimit("dse-memoryssa-scanlimit", cl::init(150), cl::Hidden,
                        cl::desc("The number of memory instructions to scan for "
-                                "dead store elimination (default = 100)"));
+                                "dead store elimination (default = 150)"));
 static cl::opt<unsigned> MemorySSAUpwardsStepLimit(
     "dse-memoryssa-walklimit", cl::init(90), cl::Hidden,
     cl::desc("The maximum number of steps while walking upwards to find "
@@ -1501,11 +1501,6 @@
     };
     PushMemUses(EarlierAccess);
 
-    // Optimistically collect all accesses for reads. If we do not find any
-    // read clobbers, add them to the cache.
-    SmallPtrSet<MemoryAccess *, 16> KnownNoReads;
-    if (!EarlierMemInst->mayReadFromMemory())
-      KnownNoReads.insert(EarlierAccess);
     // Check if EarlierDef may be read.
     for (unsigned I = 0; I < WorkList.size(); I++) {
       MemoryAccess *UseAccess = WorkList[I];
@@ -1518,7 +1513,6 @@
       }
       --ScanLimit;
       NumDomMemDefChecks++;
-      KnownNoReads.insert(UseAccess);
 
       if (isa<MemoryPhi>(UseAccess)) {
         if (any_of(KillingDefs, [this, UseAccess](Instruction *KI) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107812.365418.patch
Type: text/x-patch
Size: 1487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210810/70ac069e/attachment.bin>


More information about the llvm-commits mailing list