[PATCH] D10003: Refactor: Simplify boolean conditional return statements in lib/Transforms/Vectorize
Richard via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 24 10:06:36 PDT 2015
LegalizeAdulthood updated this revision to Diff 38308.
LegalizeAdulthood added a comment.
Updated to latest.
http://reviews.llvm.org/D10003
Files:
lib/Transforms/Vectorize/LoopVectorize.cpp
lib/Transforms/Vectorize/SLPVectorizer.cpp
Index: lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -168,10 +168,8 @@
/// 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 @@
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,
Index: lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- lib/Transforms/Vectorize/LoopVectorize.cpp
+++ lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5215,9 +5215,8 @@
}
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10003.38308.patch
Type: text/x-patch
Size: 1523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151024/8e31b351/attachment.bin>
More information about the llvm-commits
mailing list