mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
BBVectorize: Don't vectorize vector-manipulation chains
Don't choose a vectorization plan containing only shuffles and vector inserts/extracts. Due to inperfections in the cost model, these can lead to infinite recusion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1703,10 +1703,20 @@ assert(n < 10 && "hrmm, really?");
|
||||
// The set of pairs that have already contributed to the total cost.
|
||||
DenseSet<ValuePair> IncomingPairs;
|
||||
|
||||
// If the cost model were perfect, this might not be necessary; but we
|
||||
// need to make sure that we don't get stuck vectorizing our own
|
||||
// shuffle chains.
|
||||
bool HasNontrivialInsts = false;
|
||||
|
||||
// The node weights represent the cost savings associated with
|
||||
// fusing the pair of instructions.
|
||||
for (DenseSet<ValuePair>::iterator S = PrunedTree.begin(),
|
||||
E = PrunedTree.end(); S != E; ++S) {
|
||||
if (!isa<ShuffleVectorInst>(S->first) &&
|
||||
!isa<InsertElementInst>(S->first) &&
|
||||
!isa<ExtractElementInst>(S->first))
|
||||
HasNontrivialInsts = true;
|
||||
|
||||
bool FlipOrder = false;
|
||||
|
||||
if (getDepthFactor(S->first)) {
|
||||
@ -1943,6 +1953,13 @@ assert(n < 10 && "hrmm, really?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!HasNontrivialInsts) {
|
||||
DEBUG(if (DebugPairSelection) dbgs() <<
|
||||
"\tNo non-trivial instructions in tree;"
|
||||
" override to zero effective size\n");
|
||||
EffSize = 0;
|
||||
}
|
||||
} else {
|
||||
for (DenseSet<ValuePair>::iterator S = PrunedTree.begin(),
|
||||
E = PrunedTree.end(); S != E; ++S)
|
||||
|
Reference in New Issue
Block a user