summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 8cf0450dd9e..0d9e2d15652 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -468,12 +468,8 @@ public:
if (CountedInstructions.insert(LI).second)
NumberOfOptimizedInstructions += TTI.getUserCost(LI);
- for (User *U : LI->users()) {
- Instruction *UI = dyn_cast<Instruction>(U);
- if (!UI)
- continue;
- Worklist.insert(UI);
- }
+ for (User *U : LI->users())
+ Worklist.insert(cast<Instruction>(U));
}
// And then we try to simplify every user of every instruction from the
@@ -485,12 +481,8 @@ public:
continue;
if (!visit(I))
continue;
- for (User *U : I->users()) {
- Instruction *UI = dyn_cast<Instruction>(U);
- if (!UI)
- continue;
- Worklist.insert(UI);
- }
+ for (User *U : I->users())
+ Worklist.insert(cast<Instruction>(U));
}
return NumberOfOptimizedInstructions;
}
OpenPOWER on IntegriCloud