[llvm] r341733 - [MemorySSA] Relax verification of clobbering accesses.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 7 16:51:41 PDT 2018


Author: asbirlea
Date: Fri Sep  7 16:51:41 2018
New Revision: 341733

URL: http://llvm.org/viewvc/llvm-project?rev=341733&view=rev
Log:
[MemorySSA] Relax verification of clobbering accesses.

Modified:
    llvm/trunk/lib/Analysis/MemorySSA.cpp

Modified: llvm/trunk/lib/Analysis/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemorySSA.cpp?rev=341733&r1=341732&r2=341733&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemorySSA.cpp (original)
+++ llvm/trunk/lib/Analysis/MemorySSA.cpp Fri Sep  7 16:51:41 2018
@@ -380,10 +380,12 @@ static bool isUseTriviallyOptimizableToL
 /// \param MSSA      The MemorySSA instance that Start and ClobberAt belong to.
 /// \param Query     The UpwardsMemoryQuery we used for our search.
 /// \param AA        The AliasAnalysis we used for our search.
+/// \param AllowImpreciseClobber Always false, unless we do relaxed verify.
 static void
 checkClobberSanity(const MemoryAccess *Start, MemoryAccess *ClobberAt,
                    const MemoryLocation &StartLoc, const MemorySSA &MSSA,
-                   const UpwardsMemoryQuery &Query, AliasAnalysis &AA) {
+                   const UpwardsMemoryQuery &Query, AliasAnalysis &AA,
+                   bool AllowImpreciseClobber = false) {
   assert(MSSA.dominates(ClobberAt, Start) && "Clobber doesn't dominate start?");
 
   if (MSSA.isLiveOnEntryDef(Start)) {
@@ -454,6 +456,14 @@ checkClobberSanity(const MemoryAccess *S
     }
   }
 
+  // If the verify is done following an optimization, it's possible that
+  // ClobberAt was a conservative clobbering, that we can now infer is not a
+  // true clobbering access. Don't fail the verify if that's the case.
+  // We do have accesses that claim they're optimized, but could be optimized
+  // further. Updating all these can be expensive, so allow it for now (FIXME).
+  if (AllowImpreciseClobber)
+    return;
+
   // If ClobberAt is a MemoryPhi, we can assume something above it acted as a
   // clobber. Otherwise, `ClobberAt` should've acted as a clobber at some point.
   assert((isa<MemoryPhi>(ClobberAt) || FoundClobber) &&
@@ -1694,7 +1704,7 @@ void MemorySSA::checkClobberSanityAccess
       return;
     auto *Clobber = MUD->getOptimized();
     UpwardsMemoryQuery Q(I, MUD);
-    checkClobberSanity(MUD, Clobber, *Loc, *this, Q, *AA);
+    checkClobberSanity(MUD, Clobber, *Loc, *this, Q, *AA, true);
   }
 }
 




More information about the llvm-commits mailing list