[unroll] Replace a boolean, for loop, condition, and break with
std::all_of and a lambda. Much cleaner, no functionality
changed.

llvm-svn: 229058
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 4c57c92..ccc4a24 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -542,14 +542,10 @@
         continue;
       if (DeadInstructions.count(I))
         continue;
-      bool AllUsersFolded = true;
-      for (User *U : I->users())
-        if (!DeadInstructions.count(cast<Instruction>(U))) {
-          AllUsersFolded = false;
-          break;
-        }
 
-      if (AllUsersFolded) {
+      if (std::all_of(I->user_begin(), I->user_end(), [&](User *U) {
+            return DeadInstructions.count(cast<Instruction>(U));
+          })) {
         NumberOfOptimizedInstructions += TTI.getUserCost(I);
         DeadInstructions.insert(I);
         EnqueueOperands(*I);