[llvm] r366712 - [SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 22 10:57:37 PDT 2019
Author: rksimon
Date: Mon Jul 22 10:57:36 2019
New Revision: 366712
URL: http://llvm.org/viewvc/llvm-project?rev=366712&view=rev
Log:
[SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI.
Modified:
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=366712&r1=366711&r2=366712&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Mon Jul 22 10:57:36 2019
@@ -3933,7 +3933,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry
Instruction::isCast(S.getAltOpcode()))) &&
"Invalid Shuffle Vector Operand");
- Value *LHS, *RHS;
+ Value *LHS = nullptr, *RHS = nullptr;
if (Instruction::isBinaryOp(S.getOpcode())) {
setInsertPointAfterBundle(E->Scalars, S);
LHS = vectorizeTree(E->getOperand(0));
@@ -5571,7 +5571,7 @@ class HorizontalReduction {
Value *createOp(IRBuilder<> &Builder, const Twine &Name) const {
assert(isVectorizable() &&
"Expected add|fadd or min/max reduction operation.");
- Value *Cmp;
+ Value *Cmp = nullptr;
switch (Kind) {
case RK_Arithmetic:
return Builder.CreateBinOp((Instruction::BinaryOps)Opcode, LHS, RHS,
@@ -6323,7 +6323,7 @@ private:
IsPairwiseReduction = PairwiseRdxCost < SplittingRdxCost;
int VecReduxCost = IsPairwiseReduction ? PairwiseRdxCost : SplittingRdxCost;
- int ScalarReduxCost;
+ int ScalarReduxCost = 0;
switch (ReductionData.getKind()) {
case RK_Arithmetic:
ScalarReduxCost =
More information about the llvm-commits
mailing list