From 1084fa2ef262f554d9c44a2e22f2dd3eaadc984f Mon Sep 17 00:00:00 2001 From: Preston Briggs Date: Tue, 27 Nov 2012 06:41:46 +0000 Subject: Modify depends(Src, Dst, PossiblyLoopIndependent). If the Src and Dst are the same instruction, no loop-independent dependence is possible, so we force the PossiblyLoopIndependent flag to false. The test case results are updated appropriately. llvm-svn: 168678 --- llvm/lib/Analysis/DependenceAnalysis.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Analysis/DependenceAnalysis.cpp') diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index 684da98ce25..385e779a59a 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -3199,6 +3199,9 @@ static void dumpSmallBitVector(SmallBitVector &BV) { Dependence *DependenceAnalysis::depends(Instruction *Src, Instruction *Dst, bool PossiblyLoopIndependent) { + if (Src == Dst) + PossiblyLoopIndependent = false; + if ((!Src->mayReadFromMemory() && !Src->mayWriteToMemory()) || (!Dst->mayReadFromMemory() && !Dst->mayWriteToMemory())) // if both instructions don't reference memory, there's no dependence -- cgit v1.2.3