forked from OSchip/llvm-project
parent
ecf81c09f5
commit
5f7c48ebff
|
@ -1869,7 +1869,7 @@ bool SLPVectorizer::vectorizeStoreChain(ArrayRef<Value *> Chain,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SLPVectorizer::vectorizeStores(ArrayRef<StoreInst *> Stores,
|
bool SLPVectorizer::vectorizeStores(ArrayRef<StoreInst *> Stores,
|
||||||
|
@ -1974,7 +1974,7 @@ bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R) {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned Opcode0 = I0->getOpcode();
|
unsigned Opcode0 = I0->getOpcode();
|
||||||
|
|
||||||
Type *Ty0 = I0->getType();
|
Type *Ty0 = I0->getType();
|
||||||
unsigned Sz = DL->getTypeSizeInBits(Ty0);
|
unsigned Sz = DL->getTypeSizeInBits(Ty0);
|
||||||
unsigned VF = MinVecRegSize / Sz;
|
unsigned VF = MinVecRegSize / Sz;
|
||||||
|
@ -1989,11 +1989,11 @@ bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
||||||
for (unsigned i = 0, e = VL.size(); i < e; ++i) {
|
for (unsigned i = 0, e = VL.size(); i < e; ++i) {
|
||||||
unsigned OpsWidth = 0;
|
unsigned OpsWidth = 0;
|
||||||
|
|
||||||
if (i + VF > e)
|
if (i + VF > e)
|
||||||
OpsWidth = e - i;
|
OpsWidth = e - i;
|
||||||
else
|
else
|
||||||
OpsWidth = VF;
|
OpsWidth = VF;
|
||||||
|
@ -2001,23 +2001,24 @@ bool SLPVectorizer::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R) {
|
||||||
if (!isPowerOf2_32(OpsWidth) || OpsWidth < 2)
|
if (!isPowerOf2_32(OpsWidth) || OpsWidth < 2)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
DEBUG(dbgs() << "SLP: Analyzing " << OpsWidth << " operations " << "\n");
|
DEBUG(dbgs() << "SLP: Analyzing " << OpsWidth << " operations "
|
||||||
|
<< "\n");
|
||||||
ArrayRef<Value *> Ops = VL.slice(i, OpsWidth);
|
ArrayRef<Value *> Ops = VL.slice(i, OpsWidth);
|
||||||
|
|
||||||
R.buildTree(Ops);
|
R.buildTree(Ops);
|
||||||
int Cost = R.getTreeCost();
|
int Cost = R.getTreeCost();
|
||||||
|
|
||||||
if (Cost < -SLPCostThreshold) {
|
if (Cost < -SLPCostThreshold) {
|
||||||
DEBUG(dbgs() << "SLP: Vectorizing pair at cost:" << Cost << ".\n");
|
DEBUG(dbgs() << "SLP: Vectorizing pair at cost:" << Cost << ".\n");
|
||||||
R.vectorizeTree();
|
R.vectorizeTree();
|
||||||
|
|
||||||
// Move to the next bundle.
|
// Move to the next bundle.
|
||||||
i += VF - 1;
|
i += VF - 1;
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SLPVectorizer::tryToVectorize(BinaryOperator *V, BoUpSLP &R) {
|
bool SLPVectorizer::tryToVectorize(BinaryOperator *V, BoUpSLP &R) {
|
||||||
|
|
Loading…
Reference in New Issue