From 3ebd2fe91a3ee4a02be1fffe60bf62b9910ace81 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 22 Jul 2019 17:57:36 +0000 Subject: [PATCH] [SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI. llvm-svn: 366712 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 27a86c0..804a1e8 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -3933,7 +3933,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { 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 = -- 2.7.4