[llvm] r276553 - [MSSA] Make EXPENSIVE_CHECKS check more.
George Burgess IV via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 24 00:03:49 PDT 2016
Author: gbiv
Date: Sun Jul 24 02:03:49 2016
New Revision: 276553
URL: http://llvm.org/viewvc/llvm-project?rev=276553&view=rev
Log:
[MSSA] Make EXPENSIVE_CHECKS check more.
checkClobberSanity will now be run for all results of `ClobberWalk`,
instead of just the crazy phi-optimized ones. This can help us catch
cases where our cache is being wonky.
Modified:
llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
Modified: llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp?rev=276553&r1=276552&r2=276553&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp Sun Jul 24 02:03:49 2016
@@ -236,9 +236,6 @@ checkClobberSanity(MemoryAccess *Start,
return;
}
- assert((isa<MemoryPhi>(Start) || Start != ClobberAt) &&
- "Start can't clobber itself!");
-
bool FoundClobber = false;
DenseSet<MemoryAccessPair> VisitedPhis;
SmallVector<MemoryAccessPair, 8> Worklist;
@@ -818,22 +815,23 @@ public:
// Fast path for the overly-common case (no crazy phi optimization
// necessary)
UpwardsWalkResult WalkResult = walkToPhiOrClobber(FirstDesc);
+ MemoryAccess *Result;
if (WalkResult.IsKnownClobber) {
cacheDefPath(FirstDesc, WalkResult.Result);
- return WalkResult.Result;
+ Result = WalkResult.Result;
+ } else {
+ OptznResult OptRes = tryOptimizePhi(cast<MemoryPhi>(FirstDesc.Last),
+ Current, Q.StartingLoc);
+ verifyOptResult(OptRes);
+ cacheOptResult(OptRes);
+ resetPhiOptznState();
+ Result = OptRes.PrimaryClobber.Clobber;
}
- OptznResult OptRes =
- tryOptimizePhi(cast<MemoryPhi>(FirstDesc.Last), Current, Q.StartingLoc);
- verifyOptResult(OptRes);
- cacheOptResult(OptRes);
- resetPhiOptznState();
-
#ifdef EXPENSIVE_CHECKS
- checkClobberSanity(Current, OptRes.PrimaryClobber.Clobber, Q.StartingLoc,
- MSSA, Q, AA);
+ checkClobberSanity(Current, Result, Q.StartingLoc, MSSA, Q, AA);
#endif
- return OptRes.PrimaryClobber.Clobber;
+ return Result;
}
};
More information about the llvm-commits
mailing list