mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
SLP vectorizer: Don't hoist vector extracts of phis.
Extracts coming from phis were being hoisted, while all others were sunk to their uses. This was inconsistent and didn't seem to serve a purpose. Changing all extracts to be sunk to uses is a prerequisite for adding block frequency to the SLP vectorizer's cost model. I benchmarked the change in isolation (without block frequency). I only saw noise on x86 and some potentially significant improvements on ARM. No major regressions is good enough for me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204699 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b13d54f588
commit
f5bf687cf7
@ -1690,12 +1690,7 @@ Value *BoUpSLP::vectorizeTree() {
|
||||
Value *Lane = Builder.getInt32(it->Lane);
|
||||
// Generate extracts for out-of-tree users.
|
||||
// Find the insertion point for the extractelement lane.
|
||||
if (PHINode *PN = dyn_cast<PHINode>(Vec)) {
|
||||
Builder.SetInsertPoint(PN->getParent()->getFirstInsertionPt());
|
||||
Value *Ex = Builder.CreateExtractElement(Vec, Lane);
|
||||
CSEBlocks.insert(PN->getParent());
|
||||
User->replaceUsesOfWith(Scalar, Ex);
|
||||
} else if (isa<Instruction>(Vec)){
|
||||
if (isa<Instruction>(Vec)){
|
||||
if (PHINode *PH = dyn_cast<PHINode>(User)) {
|
||||
for (int i = 0, e = PH->getNumIncomingValues(); i != e; ++i) {
|
||||
if (PH->getIncomingValue(i) == Scalar) {
|
||||
|
Loading…
Reference in New Issue
Block a user