diff options
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index c80f463d1f6..04b6a76c9d4 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -423,7 +423,6 @@ static InstructionsState getSameOpcode(ArrayRef<Value *> VL) { unsigned Opcode = Res.Opcode; if (!Res.HasAltOpcodes) return InstructionsState(VL[0], Opcode, false); - auto *OpInst = cast<Instruction>(VL[0]); unsigned AltOpcode = getAltOpcode(Opcode); // Examine each element in the list instructions VL to determine // if some operations there could be considered as an alternative @@ -432,9 +431,9 @@ static InstructionsState getSameOpcode(ArrayRef<Value *> VL) { auto *I = cast<Instruction>(VL[Cnt]); unsigned InstOpcode = I->getOpcode(); if (InstOpcode != (isOdd(Cnt) ? AltOpcode : Opcode)) - return InstructionsState(OpInst, 0, false); + return InstructionsState(VL[0], 0, false); } - return InstructionsState(OpInst, Opcode, Res.HasAltOpcodes); + return InstructionsState(VL[0], Opcode, Res.HasAltOpcodes); } /// \returns true if all of the values in \p VL have the same type or false |