summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Staszak <kubastaszak@gmail.com>2012-12-09 16:06:44 +0000
committerJakub Staszak <kubastaszak@gmail.com>2012-12-09 16:06:44 +0000
commit8432185ec2f8e6b98ff0f735fc95add129ad9c79 (patch)
treeb0140bb10561ba6912ede1fd3586fc7043826925
parent18dc538690940991ffe2e2b572e1318ba047b88d (diff)
downloadbcm5719-llvm-8432185ec2f8e6b98ff0f735fc95add129ad9c79.tar.gz
bcm5719-llvm-8432185ec2f8e6b98ff0f735fc95add129ad9c79.zip
Use m_OneUse pattern instead of hasOneUse() method.
No functionality change. llvm-svn: 169703
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
index 76eb82a622b..8a28d8eaa23 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
@@ -430,9 +430,8 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
Value *Op0BOOp1 = Op0BO->getOperand(1);
if (isLeftShift && Op0BOOp1->hasOneUse() &&
match(Op0BOOp1,
- m_And(m_Shr(m_Value(V1), m_Specific(Op1)),
- m_ConstantInt(CC))) &&
- cast<BinaryOperator>(Op0BOOp1)->getOperand(0)->hasOneUse()) {
+ m_And(m_OneUse(m_Shr(m_Value(V1), m_Specific(Op1))),
+ m_ConstantInt(CC)))) {
Value *YS = // (Y << C)
Builder->CreateShl(Op0BO->getOperand(0), Op1,
Op0BO->getName());
@@ -462,10 +461,8 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
// Turn (((X >> C)&CC) + Y) << C -> (X + (Y << C)) & (CC << C)
if (isLeftShift && Op0BO->getOperand(0)->hasOneUse() &&
match(Op0BO->getOperand(0),
- m_And(m_Shr(m_Value(V1), m_Value(V2)),
- m_ConstantInt(CC))) && V2 == Op1 &&
- cast<BinaryOperator>(Op0BO->getOperand(0))
- ->getOperand(0)->hasOneUse()) {
+ m_And(m_OneUse(m_Shr(m_Value(V1), m_Value(V2))),
+ m_ConstantInt(CC))) && V2 == Op1) {
Value *YS = // (Y << C)
Builder->CreateShl(Op0BO->getOperand(1), Op1, Op0BO->getName());
// X & (CC << C)
OpenPOWER on IntegriCloud