mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-21 03:32:29 +00:00
Simplify code that tries to do vector extracts for shuffles when the mask width and the input vector widths don't match. No need to check the min and max are in range before calculating the start index. The range check after having the start index is sufficient. Also no need to check for an extract from the beginning differently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154295 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
253933ee9e
commit
f873dde502
@ -2922,19 +2922,15 @@ void SelectionDAGBuilder::visitShuffleVector(const User &I) {
|
||||
if (MinRange[Input] == (int)(SrcNumElts+1) && MaxRange[Input] == -1) {
|
||||
RangeUse[Input] = 0; // Unused
|
||||
StartIdx[Input] = 0;
|
||||
} else if (MaxRange[Input] - MinRange[Input] < (int)MaskNumElts) {
|
||||
// Fits within range but we should see if we can find a good
|
||||
// start index that is a multiple of the mask length.
|
||||
if (MaxRange[Input] < (int)MaskNumElts) {
|
||||
RangeUse[Input] = 1; // Extract from beginning of the vector
|
||||
StartIdx[Input] = 0;
|
||||
} else {
|
||||
StartIdx[Input] = (MinRange[Input]/MaskNumElts)*MaskNumElts;
|
||||
if (MaxRange[Input] - StartIdx[Input] < (int)MaskNumElts &&
|
||||
StartIdx[Input] + MaskNumElts <= SrcNumElts)
|
||||
RangeUse[Input] = 1; // Extract from a multiple of the mask length.
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Find a good start index that is a multiple of the mask length. Then
|
||||
// see if the rest of the elements are in range.
|
||||
StartIdx[Input] = (MinRange[Input]/MaskNumElts)*MaskNumElts;
|
||||
if (MaxRange[Input] - StartIdx[Input] < (int)MaskNumElts &&
|
||||
StartIdx[Input] + MaskNumElts <= SrcNumElts)
|
||||
RangeUse[Input] = 1; // Extract from a multiple of the mask length.
|
||||
}
|
||||
|
||||
if (RangeUse[0] == 0 && RangeUse[1] == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user