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
This commit is contained in:
Preston Briggs
2012-11-27 06:41:46 +00:00
parent 69ea027e04
commit 6ee74f52e9
15 changed files with 404 additions and 401 deletions

View File

@@ -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