[llvm] r272182 - [SCEV] Break out of loop if there is no more work to do

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 10:48:46 PDT 2016

Author: sanjoy
Date: Wed Jun  8 12:48:46 2016
New Revision: 272182

URL: http://llvm.org/viewvc/llvm-project?rev=272182&view=rev
[SCEV] Break out of loop if there is no more work to do

This is NFC as far as externally visible behavior is concerned, but will
keep us from spinning in the worklist traversal algorithm unnecessarily.


Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=272182&r1=272181&r2=272182&view=diff
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Jun  8 12:48:46 2016
@@ -4889,7 +4889,7 @@ bool ScalarEvolution::isAddRecNeverPoiso
   bool LatchControlDependentOnPoison = false;
-  while (!PoisonStack.empty()) {
+  while (!PoisonStack.empty() && !LatchControlDependentOnPoison) {
     const Instruction *Poison = PoisonStack.pop_back_val();
     for (auto *PoisonUser : Poison->users()) {

More information about the llvm-commits mailing list