diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 20:07:06 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 20:07:06 +0000 |
| commit | a81a6dff0d7748f05637ac07a6da7a150094c88f (patch) | |
| tree | 1b3a270ef2188a38b14c94ad5c724dc369b84cbc /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | |
| parent | 76aa677ec348ce6e88a5af977b135a05799419d4 (diff) | |
| download | bcm5719-llvm-a81a6dff0d7748f05637ac07a6da7a150094c88f.tar.gz bcm5719-llvm-a81a6dff0d7748f05637ac07a6da7a150094c88f.zip | |
Convert a ton of simple integer type equality tests to the new predicate.
llvm-svn: 92760
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index 9ffe6d1b8f0..527a7b51e11 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -867,7 +867,7 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC, // If we know that LIC == Val, or that LIC == NotVal, just replace uses of LIC // in the loop with the appropriate one directly. if (IsEqual || (isa<ConstantInt>(Val) && - Val->getType() == Type::getInt1Ty(Val->getContext()))) { + Val->getType()->isInteger(1))) { Value *Replacement; if (IsEqual) Replacement = Val; @@ -993,10 +993,10 @@ void LoopUnswitch::SimplifyCode(std::vector<Instruction*> &Worklist, Loop *L) { case Instruction::And: if (isa<ConstantInt>(I->getOperand(0)) && // constant -> RHS - I->getOperand(0)->getType() == Type::getInt1Ty(I->getContext())) + I->getOperand(0)->getType()->isInteger(1)) cast<BinaryOperator>(I)->swapOperands(); if (ConstantInt *CB = dyn_cast<ConstantInt>(I->getOperand(1))) - if (CB->getType() == Type::getInt1Ty(I->getContext())) { + if (CB->getType()->isInteger(1)) { if (CB->isOne()) // X & 1 -> X ReplaceUsesOfWith(I, I->getOperand(0), Worklist, L, LPM); else // X & 0 -> 0 @@ -1007,10 +1007,10 @@ void LoopUnswitch::SimplifyCode(std::vector<Instruction*> &Worklist, Loop *L) { case Instruction::Or: if (isa<ConstantInt>(I->getOperand(0)) && // constant -> RHS - I->getOperand(0)->getType() == Type::getInt1Ty(I->getContext())) + I->getOperand(0)->getType()->isInteger(1)) cast<BinaryOperator>(I)->swapOperands(); if (ConstantInt *CB = dyn_cast<ConstantInt>(I->getOperand(1))) - if (CB->getType() == Type::getInt1Ty(I->getContext())) { + if (CB->getType()->isInteger(1)) { if (CB->isOne()) // X | 1 -> 1 ReplaceUsesOfWith(I, I->getOperand(1), Worklist, L, LPM); else // X | 0 -> X |

