forked from OSchip/llvm-project
[X86] Improve the message for some asserts. Remove an if that is guaranteed true by said asserts.
This replaces some asserts in lowerV2F64VectorShuffle with the similar asserts from lowerVIF64VectorShuffle which are more readable. The original asserts mentioned a blend, but there's no guarantee that it is a blend. Also remove an if that the asserts prove is always true. Mask[0] is always less than 2 and Mask[1] is always at least 2. Therefore (Mask[0] >= 2) + (Mask[1] >= 2) == 1 must wlays be true. llvm-svn: 336517
This commit is contained in:
parent
c98c675f03
commit
b8145ec667
|
@ -11312,22 +11312,23 @@ static SDValue lowerV2F64VectorShuffle(const SDLoc &DL, ArrayRef<int> Mask,
|
|||
Mask[1] == SM_SentinelUndef ? DAG.getUNDEF(MVT::v2f64) : V1,
|
||||
DAG.getConstant(SHUFPDMask, DL, MVT::i8));
|
||||
}
|
||||
assert(Mask[0] >= 0 && Mask[0] < 2 && "Non-canonicalized blend!");
|
||||
assert(Mask[1] >= 2 && "Non-canonicalized blend!");
|
||||
assert(Mask[0] >= 0 && "No undef lanes in multi-input v2 shuffles!");
|
||||
assert(Mask[1] >= 0 && "No undef lanes in multi-input v2 shuffles!");
|
||||
assert(Mask[0] < 2 && "We sort V1 to be the first input.");
|
||||
assert(Mask[1] >= 2 && "We sort V2 to be the second input.");
|
||||
|
||||
// If we have a single input, insert that into V1 if we can do so cheaply.
|
||||
if ((Mask[0] >= 2) + (Mask[1] >= 2) == 1) {
|
||||
if (SDValue Insertion = lowerVectorShuffleAsElementInsertion(
|
||||
DL, MVT::v2f64, V1, V2, Mask, Zeroable, Subtarget, DAG))
|
||||
return Insertion;
|
||||
// Try inverting the insertion since for v2 masks it is easy to do and we
|
||||
// can't reliably sort the mask one way or the other.
|
||||
int InverseMask[2] = {Mask[0] < 0 ? -1 : (Mask[0] ^ 2),
|
||||
Mask[1] < 0 ? -1 : (Mask[1] ^ 2)};
|
||||
if (SDValue Insertion = lowerVectorShuffleAsElementInsertion(
|
||||
DL, MVT::v2f64, V2, V1, InverseMask, Zeroable, Subtarget, DAG))
|
||||
return Insertion;
|
||||
}
|
||||
// When loading a scalar and then shuffling it into a vector we can often do
|
||||
// the insertion cheaply.
|
||||
if (SDValue Insertion = lowerVectorShuffleAsElementInsertion(
|
||||
DL, MVT::v2f64, V1, V2, Mask, Zeroable, Subtarget, DAG))
|
||||
return Insertion;
|
||||
// Try inverting the insertion since for v2 masks it is easy to do and we
|
||||
// can't reliably sort the mask one way or the other.
|
||||
int InverseMask[2] = {Mask[0] < 0 ? -1 : (Mask[0] ^ 2),
|
||||
Mask[1] < 0 ? -1 : (Mask[1] ^ 2)};
|
||||
if (SDValue Insertion = lowerVectorShuffleAsElementInsertion(
|
||||
DL, MVT::v2f64, V2, V1, InverseMask, Zeroable, Subtarget, DAG))
|
||||
return Insertion;
|
||||
|
||||
// Try to use one of the special instruction patterns to handle two common
|
||||
// blend patterns if a zero-blend above didn't work.
|
||||
|
|
Loading…
Reference in New Issue