summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/PredicateSimplifier.cpp')
-rw-r--r--lib/Transforms/Scalar/PredicateSimplifier.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/Transforms/Scalar/PredicateSimplifier.cpp b/lib/Transforms/Scalar/PredicateSimplifier.cpp
index a7e4d6e..b9b5688 100644
--- a/lib/Transforms/Scalar/PredicateSimplifier.cpp
+++ b/lib/Transforms/Scalar/PredicateSimplifier.cpp
@@ -1525,12 +1525,12 @@ namespace {
Instruction *I2 = dyn_cast<Instruction>(R);
if (I2 && below(I2)) {
std::vector<Instruction *> ToNotify;
- for (Value::use_iterator UI = R->use_begin(), UE = R->use_end();
+ for (Value::use_iterator UI = I2->use_begin(), UE = I2->use_end();
UI != UE;) {
Use &TheUse = UI.getUse();
++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser()))
- ToNotify.push_back(I);
+ Instruction *I = cast<Instruction>(TheUse.getUser());
+ ToNotify.push_back(I);
}
DOUT << "Simply removing " << *I2
@@ -1658,10 +1658,9 @@ namespace {
++UI;
Value *V = TheUse.getUser();
if (!V->use_empty()) {
- if (Instruction *Inst = dyn_cast<Instruction>(V)) {
- if (aboveOrBelow(Inst))
- opsToDef(Inst);
- }
+ Instruction *Inst = cast<Instruction>(V);
+ if (aboveOrBelow(Inst))
+ opsToDef(Inst);
}
}
}
@@ -2262,10 +2261,9 @@ namespace {
UE = O.LHS->use_end(); UI != UE;) {
Use &TheUse = UI.getUse();
++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser())) {
- if (aboveOrBelow(I))
- opsToDef(I);
- }
+ Instruction *I = cast<Instruction>(TheUse.getUser());
+ if (aboveOrBelow(I))
+ opsToDef(I);
}
}
if (Instruction *I2 = dyn_cast<Instruction>(O.RHS)) {
@@ -2277,10 +2275,9 @@ namespace {
UE = O.RHS->use_end(); UI != UE;) {
Use &TheUse = UI.getUse();
++UI;
- if (Instruction *I = dyn_cast<Instruction>(TheUse.getUser())) {
- if (aboveOrBelow(I))
- opsToDef(I);
- }
+ Instruction *I = cast<Instruction>(TheUse.getUser());
+ if (aboveOrBelow(I))
+ opsToDef(I);
}
}
}