[X86][SSE] Check for out of bounds PEXTR/PINSR indices during faux shuffle combining.
llvm-svn: 323045
This commit is contained in:
parent
9cee52732f
commit
89540d9665
|
@ -6014,8 +6014,11 @@ static bool getFauxShuffleMask(SDValue N, SmallVectorImpl<int> &Mask,
|
|||
case X86ISD::PINSRW: {
|
||||
SDValue InVec = N.getOperand(0);
|
||||
SDValue InScl = N.getOperand(1);
|
||||
SDValue InIndex = N.getOperand(2);
|
||||
if (!isa<ConstantSDNode>(InIndex) ||
|
||||
cast<ConstantSDNode>(InIndex)->getAPIntValue().uge(NumElts))
|
||||
return false;
|
||||
uint64_t InIdx = N.getConstantOperandVal(2);
|
||||
assert(InIdx < NumElts && "Illegal insertion index");
|
||||
|
||||
// Attempt to recognise a PINSR*(VEC, 0, Idx) shuffle pattern.
|
||||
if (X86::isZeroNode(InScl)) {
|
||||
|
@ -6033,8 +6036,12 @@ static bool getFauxShuffleMask(SDValue N, SmallVectorImpl<int> &Mask,
|
|||
return false;
|
||||
|
||||
SDValue ExVec = InScl.getOperand(0);
|
||||
SDValue ExIndex = InScl.getOperand(1);
|
||||
if (!isa<ConstantSDNode>(ExIndex) ||
|
||||
cast<ConstantSDNode>(ExIndex)->getAPIntValue().uge(NumElts))
|
||||
return false;
|
||||
uint64_t ExIdx = InScl.getConstantOperandVal(1);
|
||||
assert(ExIdx < NumElts && "Illegal extraction index");
|
||||
|
||||
Ops.push_back(InVec);
|
||||
Ops.push_back(ExVec);
|
||||
for (unsigned i = 0; i != NumElts; ++i)
|
||||
|
|
Loading…
Reference in New Issue