Add a comment.
authorDan Gohman <gohman@apple.com>
Mon, 16 Aug 2010 16:31:39 +0000 (16:31 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 16 Aug 2010 16:31:39 +0000 (16:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111145 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index 20b886e4aa02b5177fd4831867c933c24c8929e1..81194adb37373e1be27c7e92775f0d3bcf06c89d 100644 (file)
@@ -2468,6 +2468,11 @@ const SCEV *ScalarEvolution::getSCEV(Value *V) {
   std::map<SCEVCallbackVH, const SCEV *>::const_iterator I = Scalars.find(V);
   if (I != Scalars.end()) return I->second;
   const SCEV *S = createSCEV(V);
+
+  // The process of creating a SCEV for V may have caused other SCEVs
+  // to have been created, so it's necessary to insert the new entry
+  // from scratch, rather than trying to remember the insert position
+  // above.
   Scalars.insert(std::make_pair(SCEVCallbackVH(V, this), S));
   return S;
 }