[llvm] [Analysis][NFC] Clean-up in ScalarEvolution when copying predicates (PR #108851)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 01:24:01 PDT 2024


================
@@ -8594,8 +8594,7 @@ const SCEV *ScalarEvolution::BackedgeTakenInfo::getExact(
     Ops.push_back(BECount);
 
     if (Preds)
-      for (const auto *P : ENT.Predicates)
-        Preds->push_back(P);
+      Preds->append(ENT.Predicates.begin(), ENT.Predicates.end());
----------------
david-arm wrote:

Good suggestion, thanks! It does work when appending to a SmallVector.

https://github.com/llvm/llvm-project/pull/108851


More information about the llvm-commits mailing list