Reapply 105544.
authorDan Gohman <gohman@apple.com>
Fri, 18 Jun 2010 19:09:27 +0000 (19:09 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 18 Jun 2010 19:09:27 +0000 (19:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106301 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index b2ac2aec643ee52cd55a0ae57c0a9e5c77f37e02..92b2ecd72b2110a1ba968bf0c19574acc6f655cf 100644 (file)
@@ -1275,9 +1275,9 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
   assert(!Ops.empty() && "Cannot get empty add!");
   if (Ops.size() == 1) return Ops[0];
 #ifndef NDEBUG
+  const Type *ETy = getEffectiveSCEVType(Ops[0]->getType());
   for (unsigned i = 1, e = Ops.size(); i != e; ++i)
-    assert(getEffectiveSCEVType(Ops[i]->getType()) ==
-           getEffectiveSCEVType(Ops[0]->getType()) &&
+    assert(getEffectiveSCEVType(Ops[i]->getType()) == ETy &&
            "SCEVAddExpr operand types don't match!");
 #endif