[llvm] r269052 - [LAA] Use re-written SCEV expressions when computing distances
Silviu Baranga via llvm-commits
llvm-commits at lists.llvm.org
Tue May 10 05:28:50 PDT 2016
Author: sbaranga
Date: Tue May 10 07:28:49 2016
New Revision: 269052
URL: http://llvm.org/viewvc/llvm-project?rev=269052&view=rev
Log:
[LAA] Use re-written SCEV expressions when computing distances
This removes a redundant stride versioning step (we already
do it in getPtrStride, so it has no effect) and uses PSE to
get the SCEV expressions for the source and destination
(this might have changed when getPtrStride was called).
I discovered this through code inspection, and couldn't
produce a regression test for it.
Modified:
llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=269052&r1=269051&r2=269052&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Tue May 10 07:28:49 2016
@@ -1158,20 +1158,15 @@ MemoryDepChecker::isDependent(const MemA
BPtr->getType()->getPointerAddressSpace())
return Dependence::Unknown;
- const SCEV *AScev = replaceSymbolicStrideSCEV(PSE, Strides, APtr);
- const SCEV *BScev = replaceSymbolicStrideSCEV(PSE, Strides, BPtr);
-
int StrideAPtr = getPtrStride(PSE, APtr, InnermostLoop, Strides, true);
int StrideBPtr = getPtrStride(PSE, BPtr, InnermostLoop, Strides, true);
- const SCEV *Src = AScev;
- const SCEV *Sink = BScev;
+ const SCEV *Src = PSE.getSCEV(APtr);
+ const SCEV *Sink = PSE.getSCEV(BPtr);
// If the induction step is negative we have to invert source and sink of the
// dependence.
if (StrideAPtr < 0) {
- //Src = BScev;
- //Sink = AScev;
std::swap(APtr, BPtr);
std::swap(Src, Sink);
std::swap(AIsWrite, BIsWrite);
More information about the llvm-commits
mailing list