summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-07 09:21:09 +0000
committered <ed@FreeBSD.org>2009-06-07 09:21:09 +0000
commite65fe1a3e103e3aa81b69704d20eb95f54097271 (patch)
tree7faa7e6887831d68515763b37bd680e3d4a886ea /lib/Transforms/Scalar/PredicateSimplifier.cpp
parent2361a5c2bfbaef476824e51fa72712e334219c7b (diff)
downloadFreeBSD-src-e65fe1a3e103e3aa81b69704d20eb95f54097271.zip
FreeBSD-src-e65fe1a3e103e3aa81b69704d20eb95f54097271.tar.gz
Import LLVM r73021.
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);
}
}
}
OpenPOWER on IntegriCloud