summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-02-13 04:33:21 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-02-13 04:33:21 +0000
commitd9591d89225e3140b365a7cab1b482f1743cff99 (patch)
treef763d4949f5c9f92f8c197242c3bbec04bf5a638 /llvm/lib/Transforms
parent5457e20d2739db63f654c70269418a8153e8c945 (diff)
downloadbcm5719-llvm-d9591d89225e3140b365a7cab1b482f1743cff99.tar.gz
bcm5719-llvm-d9591d89225e3140b365a7cab1b482f1743cff99.zip
[unroll] Remove pointless dyn_cast<>s to Instruction - the users of an
instruction must by definition be instructions. llvm-svn: 229061
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