mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
SLP Vectorizer: Extract cost will only be added once even if the scalar has multiple external uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1082,9 +1082,13 @@ int BoUpSLP::getTreeCost() {
|
||||
Cost += C;
|
||||
}
|
||||
|
||||
SmallSet<Value *, 16> ExtractCostCalculated;
|
||||
int ExtractCost = 0;
|
||||
for (UserList::iterator I = ExternalUses.begin(), E = ExternalUses.end();
|
||||
I != E; ++I) {
|
||||
// We only add extract cost once for the same scalar.
|
||||
if (!ExtractCostCalculated.insert(I->Scalar))
|
||||
continue;
|
||||
|
||||
VectorType *VecTy = VectorType::get(I->Scalar->getType(), BundleWidth);
|
||||
ExtractCost += TTI->getVectorInstrCost(Instruction::ExtractElement, VecTy,
|
||||
|
Reference in New Issue
Block a user