summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-25 15:53:55 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-25 15:53:55 +0000
commitff3abef395097f7c068dac6feae42c53b7d1e26e (patch)
tree6c5d87814a8fa6dc5248b4eabdef19b0c88a494f /llvm/lib
parentae3fefe3978237a8b71a6a08a11caab4485b87a4 (diff)
downloadbcm5719-llvm-ff3abef395097f7c068dac6feae42c53b7d1e26e.tar.gz
bcm5719-llvm-ff3abef395097f7c068dac6feae42c53b7d1e26e.zip
[SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization
Remove attempts to commute non-Instructions to the LHS - the codegen changes appear to rely on chance more than anything else and also have a tendency to fight existing instcombine canonicalization which moves constants to the RHS of commutable binary ops. This is prep work towards: (a) reusing reorderInputsAccordingToOpcode for alt-shuffles and removing the similar reorderAltShuffleOperands (b) improving reordering to optimized cases with commutable and non-commutable instructions to still find splat/consecutive ops. Differential Revision: https://reviews.llvm.org/D59738 llvm-svn: 356913
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 7ed1183c05f..983b8fa4af1 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -2922,13 +2922,8 @@ void BoUpSLP::reorderInputsAccordingToOpcode(const InstructionsState &S,
// Peel the first iteration out of the loop since there's nothing
// interesting to do anyway and it simplifies the checks in the loop.
auto *I = cast<Instruction>(VL[0]);
- Value *VLeft = I->getOperand(0);
- Value *VRight = I->getOperand(1);
- if (!isa<Instruction>(VRight) && isa<Instruction>(VLeft))
- // Favor having instruction to the right. FIXME: why?
- std::swap(VLeft, VRight);
- Left.push_back(VLeft);
- Right.push_back(VRight);
+ Left.push_back(I->getOperand(0));
+ Right.push_back(I->getOperand(1));
}
// Keep track if we have instructions with all the same opcode on one side.
OpenPOWER on IntegriCloud