[llvm] r251206 - Refactor: Simplify boolean conditional return statements in lib/Transforms/Vectorize (NFC).
Michael Zolotukhin via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 24 13:16:43 PDT 2015
Author: mzolotukhin
Date: Sat Oct 24 15:16:42 2015
New Revision: 251206
URL: http://llvm.org/viewvc/llvm-project?rev=251206&view=rev
Log:
Refactor: Simplify boolean conditional return statements in lib/Transforms/Vectorize (NFC).
Summary: Use clang-tidy to simplify boolean conditional return statements
Differential Revision: http://reviews.llvm.org/D10003
Patch by Richard<legalize at xmission.com>
Modified:
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=251206&r1=251205&r2=251206&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Sat Oct 24 15:16:42 2015
@@ -5215,9 +5215,8 @@ static bool isLikelyComplexAddressComput
}
static bool isStrideMul(Instruction *I, LoopVectorizationLegality *Legal) {
- if (Legal->hasStride(I->getOperand(0)) || Legal->hasStride(I->getOperand(1)))
- return true;
- return false;
+ return Legal->hasStride(I->getOperand(0)) ||
+ Legal->hasStride(I->getOperand(1));
}
unsigned
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=251206&r1=251205&r2=251206&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Sat Oct 24 15:16:42 2015
@@ -168,10 +168,8 @@ static unsigned getAltOpcode(unsigned Op
/// of an alternate sequence which can later be merged as
/// a ShuffleVector instruction.
static bool canCombineAsAltInst(unsigned Op) {
- if (Op == Instruction::FAdd || Op == Instruction::FSub ||
- Op == Instruction::Sub || Op == Instruction::Add)
- return true;
- return false;
+ return Op == Instruction::FAdd || Op == Instruction::FSub ||
+ Op == Instruction::Sub || Op == Instruction::Add;
}
/// \returns ShuffleVector instruction if instructions in \p VL have
@@ -1990,10 +1988,7 @@ static bool shouldReorderOperands(int i,
return false;
}
// One opcode, put the instruction on the right.
- if (ILeft) {
- return true;
- }
- return false;
+ return ILeft != nullptr;
}
void BoUpSLP::reorderInputsAccordingToOpcode(ArrayRef<Value *> VL,
More information about the llvm-commits
mailing list