aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2006-09-23 15:13:08 +0000
committerNick Lewycky <nicholas@mxc.ca>2006-09-23 15:13:08 +0000
commit8f389d8cd4c0e3d1eeb2cf93d1cbfe0948c363a4 (patch)
tree9dd100c4a3ce031b3ebd5182b680eb4b1c62483e /lib/Transforms/Scalar/PredicateSimplifier.cpp
parent120fce5540b34f81ee5773d30548ce7cc2b5f571 (diff)
Style changes only. Remove dead code, fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/PredicateSimplifier.cpp')
-rw-r--r--lib/Transforms/Scalar/PredicateSimplifier.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/Transforms/Scalar/PredicateSimplifier.cpp b/lib/Transforms/Scalar/PredicateSimplifier.cpp
index 7fca951cca..04755de79c 100644
--- a/lib/Transforms/Scalar/PredicateSimplifier.cpp
+++ b/lib/Transforms/Scalar/PredicateSimplifier.cpp
@@ -72,10 +72,6 @@ namespace {
return leaders.empty();
}
- typename std::vector<ElemTy>::size_type countLeaders() const {
- return leaders.size();
- }
-
iterator findLeader(ElemTy e) {
typename std::map<ElemTy, unsigned>::iterator MI = mapping.find(e);
if (MI == mapping.end()) return 0;
@@ -140,8 +136,7 @@ namespace {
/// Represents the set of equivalent Value*s and provides insertion
/// and fast lookup. Also stores the set of inequality relationships.
class PropertySet {
- /// Returns true if V1 is a better choice than V2. Note that it is
- /// not a total ordering.
+ /// Returns true if V1 is a better choice than V2.
bool compare(Value *V1, Value *V2) const {
if (isa<Constant>(V1)) {
if (!isa<Constant>(V2)) {
@@ -393,8 +388,6 @@ namespace {
void debug(std::ostream &os) const {
static const char *OpcodeTable[] = { "EQ", "NE" };
- unsigned int size = union_find.countLeaders();
-
union_find.debug(os);
for (std::vector<Property>::const_iterator I = Properties.begin(),
E = Properties.end(); I != E; ++I) {
@@ -552,8 +545,8 @@ Value *PredicateSimplifier::resolve(BinaryOperator *BO,
Value *lhs = resolve(BO->getOperand(0), KP),
*rhs = resolve(BO->getOperand(1), KP);
- ConstantIntegral *CI1 = dyn_cast<ConstantIntegral>(lhs);
- ConstantIntegral *CI2 = dyn_cast<ConstantIntegral>(rhs);
+ ConstantIntegral *CI1 = dyn_cast<ConstantIntegral>(lhs),
+ *CI2 = dyn_cast<ConstantIntegral>(rhs);
if (CI1 && CI2) return ConstantExpr::get(BO->getOpcode(), CI1, CI2);
@@ -612,7 +605,7 @@ void PredicateSimplifier::visitInstruction(Instruction *I,
if (V != Oper) {
modified = true;
++NumVarsReplaced;
- DEBUG(std::cerr << "resolving " << *I);
+ DEBUG(std::cerr << "Resolving " << *I);
I->setOperand(i, V);
DEBUG(std::cerr << "into " << *I);
}