mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
If we have an undef mask our Elt will be -1 for our access, handle
this by using an undef as a pointer. Fixes rdar://8625016 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -6190,7 +6190,7 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
|
|||||||
SDValue EltNo = N->getOperand(1);
|
SDValue EltNo = N->getOperand(1);
|
||||||
|
|
||||||
if (isa<ConstantSDNode>(EltNo)) {
|
if (isa<ConstantSDNode>(EltNo)) {
|
||||||
unsigned Elt = cast<ConstantSDNode>(EltNo)->getZExtValue();
|
int Elt = cast<ConstantSDNode>(EltNo)->getZExtValue();
|
||||||
bool NewLoad = false;
|
bool NewLoad = false;
|
||||||
bool BCNumEltsChanged = false;
|
bool BCNumEltsChanged = false;
|
||||||
EVT VT = InVec.getValueType();
|
EVT VT = InVec.getValueType();
|
||||||
@@ -6228,7 +6228,7 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
|
|||||||
|
|
||||||
// Select the input vector, guarding against out of range extract vector.
|
// Select the input vector, guarding against out of range extract vector.
|
||||||
unsigned NumElems = VT.getVectorNumElements();
|
unsigned NumElems = VT.getVectorNumElements();
|
||||||
int Idx = (Elt > NumElems) ? -1 : SVN->getMaskElt(Elt);
|
int Idx = (Elt > (int)NumElems) ? -1 : SVN->getMaskElt(Elt);
|
||||||
InVec = (Idx < (int)NumElems) ? InVec.getOperand(0) : InVec.getOperand(1);
|
InVec = (Idx < (int)NumElems) ? InVec.getOperand(0) : InVec.getOperand(1);
|
||||||
|
|
||||||
if (InVec.getOpcode() == ISD::BIT_CONVERT)
|
if (InVec.getOpcode() == ISD::BIT_CONVERT)
|
||||||
@@ -6257,7 +6257,11 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
|
|||||||
|
|
||||||
SDValue NewPtr = LN0->getBasePtr();
|
SDValue NewPtr = LN0->getBasePtr();
|
||||||
unsigned PtrOff = 0;
|
unsigned PtrOff = 0;
|
||||||
if (Elt) {
|
// If Idx was -1 above, Elt is going to be -1, so just use undef as our
|
||||||
|
// new pointer.
|
||||||
|
if (Elt == -1) {
|
||||||
|
NewPtr = DAG.getUNDEF(NewPtr.getValueType());
|
||||||
|
} else if (Elt) {
|
||||||
PtrOff = LVT.getSizeInBits() * Elt / 8;
|
PtrOff = LVT.getSizeInBits() * Elt / 8;
|
||||||
EVT PtrType = NewPtr.getValueType();
|
EVT PtrType = NewPtr.getValueType();
|
||||||
if (TLI.isBigEndian())
|
if (TLI.isBigEndian())
|
||||||
|
Reference in New Issue
Block a user