diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-12-02 06:18:11 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-12-02 06:18:11 +0000 |
commit | 29976b9e12a4a86be51008b63e45d1b4d8b9e42f (patch) | |
tree | d184a2d8454823e24c1ddfb297f1705cadee4373 | |
parent | b6bbe6320b4a60b7399eea08426aec834701d514 (diff) |
More styalistic changes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60401 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 34c5fb3375..db2c997d3f 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -4438,22 +4438,19 @@ Instruction *InstCombiner::FoldOrWithConstants(BinaryOperator &I, Value *Op, if (!CI1) return 0; Value *V1 = 0, *C2 = 0; - if (match(Op, m_And(m_Value(V1), m_Value(C2)))) { - ConstantInt *CI2 = dyn_cast<ConstantInt>(C2); - if (!CI2) return 0; + if (!match(Op, m_And(m_Value(V1), m_ConstantInt(C2)))) return 0; - APInt Xor = CI1->getValue() ^ CI2->getValue(); - if (Xor.isAllOnesValue()) { - if (V1 == B) { - Instruction *NewOp = - InsertNewInstBefore(BinaryOperator::CreateAnd(A, CI1), I); - return BinaryOperator::CreateOr(NewOp, B); - } else if (V1 == A) { - Instruction *NewOp = - InsertNewInstBefore(BinaryOperator::CreateAnd(B, CI1), I); - return BinaryOperator::CreateOr(NewOp, A); - } - } + APInt Xor = CI1->getValue() ^ CI2->getValue(); + if (!Xor.isAllOnesValue()) return 0; + + if (V1 == B) { + Instruction *NewOp = + InsertNewInstBefore(BinaryOperator::CreateAnd(A, CI1), I); + return BinaryOperator::CreateOr(NewOp, B); + } else if (V1 == A) { + Instruction *NewOp = + InsertNewInstBefore(BinaryOperator::CreateAnd(B, CI1), I); + return BinaryOperator::CreateOr(NewOp, A); } return 0; |