summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-15 01:56:08 +0000
committerChris Lattner <sabre@nondot.org>2011-02-15 01:56:08 +0000
commit9f0ac0dd8b4e6b3bed39cd049356bb99adffe529 (patch)
tree48f5e060db0b419a9731d6c7ed431eb0914c64e0 /llvm/lib
parentd33ab8c63546beb925338c1131bb23e8ada84553 (diff)
downloadbcm5719-llvm-9f0ac0dd8b4e6b3bed39cd049356bb99adffe529.tar.gz
bcm5719-llvm-9f0ac0dd8b4e6b3bed39cd049356bb99adffe529.zip
tidy up a bit.
llvm-svn: 125546
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 36870082144..d9380be4c67 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -274,10 +274,11 @@ Instruction *InstCombiner::OptAndOp(Instruction *Op,
ConstantInt *CI = ConstantInt::get(AndRHS->getContext(),
AndRHS->getValue() & ShlMask);
- if (CI->getValue() == ShlMask) {
- // Masking out bits that the shift already masks
+ if (CI->getValue() == ShlMask)
+ // Masking out bits that the shift already masks.
return ReplaceInstUsesWith(TheAnd, Op); // No need for the and.
- } else if (CI != AndRHS) { // Reducing bits set in and.
+
+ if (CI != AndRHS) { // Reducing bits set in and.
TheAnd.setOperand(1, CI);
return &TheAnd;
}
@@ -294,10 +295,11 @@ Instruction *InstCombiner::OptAndOp(Instruction *Op,
ConstantInt *CI = ConstantInt::get(Op->getContext(),
AndRHS->getValue() & ShrMask);
- if (CI->getValue() == ShrMask) {
- // Masking out bits that the shift already masks.
+ if (CI->getValue() == ShrMask)
+ // Masking out bits that the shift already masks.
return ReplaceInstUsesWith(TheAnd, Op);
- } else if (CI != AndRHS) {
+
+ if (CI != AndRHS) {
TheAnd.setOperand(1, CI); // Reduce bits set in and cst.
return &TheAnd;
}
@@ -1065,7 +1067,7 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
}
break;
}
-
+
if (ConstantInt *Op0CI = dyn_cast<ConstantInt>(Op0I->getOperand(1)))
if (Instruction *Res = OptAndOp(Op0I, Op0CI, AndRHS, I))
return Res;
OpenPOWER on IntegriCloud