diff options
author | Jakub Staszak <kubastaszak@gmail.com> | 2013-07-22 23:38:16 +0000 |
---|---|---|
committer | Jakub Staszak <kubastaszak@gmail.com> | 2013-07-22 23:38:16 +0000 |
commit | eb0588b9920984fed0e6740a52d0e36feeaa9904 (patch) | |
tree | 1e6b0f08658be06ecda620643d8b1a0112dffc5d /lib | |
parent | a18c5748989d0b2889d076a2951be17ce61d4f69 (diff) | |
download | llvm-eb0588b9920984fed0e6740a52d0e36feeaa9904.tar.gz llvm-eb0588b9920984fed0e6740a52d0e36feeaa9904.tar.bz2 llvm-eb0588b9920984fed0e6740a52d0e36feeaa9904.tar.xz |
Use switch instead of if. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/Reassociate.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 8203dcf907..328a9c5755 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/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) { |