summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorJakub Staszak <kubastaszak@gmail.com>2013-07-22 23:38:16 +0000
committerJakub Staszak <kubastaszak@gmail.com>2013-07-22 23:38:16 +0000
commitd4d94065e3f690b2902cf0a7b66214277c26df06 (patch)
tree1359c51cb57eeb77d7d0b6cebcfe92f213198bde /llvm/lib/Transforms/Scalar/Reassociate.cpp
parentd1eec9cc96fed4ca04dd512db0d1f72000ddf33f (diff)
downloadbcm5719-llvm-d4d94065e3f690b2902cf0a7b66214277c26df06.tar.gz
bcm5719-llvm-d4d94065e3f690b2902cf0a7b66214277c26df06.zip
Use switch instead of if. No functionality change.
llvm-svn: 186892
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/Reassociate.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index 8203dcf907b..328a9c5755b 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -241,21 +241,24 @@ static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {
}
static bool isUnmovableInstruction(Instruction *I) {
- if (I->getOpcode() == Instruction::PHI ||
- I->getOpcode() == Instruction::LandingPad ||
- I->getOpcode() == Instruction::Alloca ||
- I->getOpcode() == Instruction::Load ||
- I->getOpcode() == Instruction::Invoke ||
- (I->getOpcode() == Instruction::Call &&
- !isa<DbgInfoIntrinsic>(I)) ||
- I->getOpcode() == Instruction::UDiv ||
- I->getOpcode() == Instruction::SDiv ||
- I->getOpcode() == Instruction::FDiv ||
- I->getOpcode() == Instruction::URem ||
- I->getOpcode() == Instruction::SRem ||
- I->getOpcode() == Instruction::FRem)
+ switch (I->getOpcode()) {
+ case Instruction::PHI:
+ case Instruction::LandingPad:
+ case Instruction::Alloca:
+ case Instruction::Load:
+ case Instruction::Invoke:
+ case Instruction::UDiv:
+ case Instruction::SDiv:
+ case Instruction::FDiv:
+ case Instruction::URem:
+ case Instruction::SRem:
+ case Instruction::FRem:
return true;
- return false;
+ case Instruction::Call:
+ return !isa<DbgInfoIntrinsic>(I);
+ default:
+ return false;
+ }
}
void Reassociate::BuildRankMap(Function &F) {
OpenPOWER on IntegriCloud