[llvm] r356832 - [SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 23 06:44:06 PDT 2019
Author: rksimon
Date: Sat Mar 23 06:44:06 2019
New Revision: 356832
URL: http://llvm.org/viewvc/llvm-project?rev=356832&view=rev
Log:
[SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. 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=356832&r1=356831&r2=356832&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Sat Mar 23 06:44:06 2019
@@ -683,7 +683,8 @@ private:
/// \reorder commutative operands to get better probability of
/// generating vectorized code.
- void reorderInputsAccordingToOpcode(unsigned Opcode, ArrayRef<Value *> VL,
+ void reorderInputsAccordingToOpcode(const InstructionsState &S,
+ ArrayRef<Value *> VL,
SmallVectorImpl<Value *> &Left,
SmallVectorImpl<Value *> &Right);
struct TreeEntry {
@@ -1896,7 +1897,7 @@ void BoUpSLP::buildTree_rec(ArrayRef<Val
// have the same opcode.
if (isa<BinaryOperator>(VL0) && VL0->isCommutative()) {
ValueList Left, Right;
- reorderInputsAccordingToOpcode(S.getOpcode(), VL, Left, Right);
+ reorderInputsAccordingToOpcode(S, VL, Left, Right);
UserTreeIdx.EdgeIdx = 0;
buildTree_rec(Left, Depth + 1, UserTreeIdx);
UserTreeIdx.EdgeIdx = 1;
@@ -2910,10 +2911,12 @@ static bool shouldReorderOperands(
return false;
}
-void BoUpSLP::reorderInputsAccordingToOpcode(unsigned Opcode,
+void BoUpSLP::reorderInputsAccordingToOpcode(const InstructionsState &S,
ArrayRef<Value *> VL,
SmallVectorImpl<Value *> &Left,
SmallVectorImpl<Value *> &Right) {
+ unsigned Opcode = S.getOpcode();
+
if (!VL.empty()) {
// Peel the first iteration out of the loop since there's nothing
// interesting to do anyway and it simplifies the checks in the loop.
More information about the llvm-commits
mailing list