From 6ee74f52e987036ced56293d50580f8208b863f5 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168678 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DependenceAnalysis.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Analysis/DependenceAnalysis.cpp') diff --git a/lib/Analysis/DependenceAnalysis.cpp b/lib/Analysis/DependenceAnalysis.cpp index 684da98ce2..385e779a59 100644 --- a/lib/Analysis/DependenceAnalysis.cpp +++ b/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-18-g5258