diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-06-13 10:49:24 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-06-13 10:49:24 +0000 |
commit | 2c9d2adff5b59485a027b27172008cdd25cdc5a8 (patch) | |
tree | 16b903a99d3187a9fca500cabe6c478990286f83 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | 1224260f8386ba04123643c51dc60cb430343279 (diff) | |
download | bcm5719-llvm-2c9d2adff5b59485a027b27172008cdd25cdc5a8.tar.gz bcm5719-llvm-2c9d2adff5b59485a027b27172008cdd25cdc5a8.zip |
[SLPVectorizer] getSameOpcode - remove useless cast [NFC]
There's no need to cast the base Value to an Instruction
llvm-svn: 334588
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 |