Simplify the ZIV tester to the max.
authorAndreas Bolka <a@bolka.at>
Thu, 6 Aug 2009 03:10:33 +0000 (03:10 +0000)
committerAndreas Bolka <a@bolka.at>
Thu, 6 Aug 2009 03:10:33 +0000 (03:10 +0000)
As suggested by Nick Lewycky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78277 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LoopDependenceAnalysis.cpp

index 10a6a8eb06f500bdedbf6909a32526ac9d04777f..eb8ea0ebdb0b1cdc8bafd2fdad00d6e858a7efb8 100644 (file)
@@ -144,9 +144,8 @@ LoopDependenceAnalysis::DependenceResult
 LoopDependenceAnalysis::analyseZIV(const SCEV *A,
                                    const SCEV *B,
                                    Subscript *S) const {
-  assert(isZIVPair(A, B));
-  const SCEV *diff = SE->getMinusSCEV(A, B);
-  return diff->isZero() ? Dependent : Independent;
+  assert(isZIVPair(A, B) && "Attempted to ZIV-test non-ZIV SCEVs!");
+  return A == B ? Dependent : Independent;
 }
 
 LoopDependenceAnalysis::DependenceResult