mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Make fix for r60829 less conservative to allow the proper optimization for
vec_extract-sse4.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60865 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0ffa3de9e9
commit
a60b5236c1
@ -4884,14 +4884,16 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
if (isa<ConstantSDNode>(EltNo)) {
|
||||
unsigned Elt = cast<ConstantSDNode>(EltNo)->getZExtValue();
|
||||
bool NewLoad = false;
|
||||
bool BCNumEltsChanged = false;
|
||||
MVT VT = InVec.getValueType();
|
||||
MVT EVT = VT.getVectorElementType();
|
||||
MVT LVT = EVT;
|
||||
if (InVec.getOpcode() == ISD::BIT_CONVERT) {
|
||||
MVT BCVT = InVec.getOperand(0).getValueType();
|
||||
if (!BCVT.isVector() || EVT.bitsGT(BCVT.getVectorElementType()) ||
|
||||
VT.getVectorNumElements() != BCVT.getVectorNumElements())
|
||||
if (!BCVT.isVector() || EVT.bitsGT(BCVT.getVectorElementType()))
|
||||
return SDValue();
|
||||
if (VT.getVectorNumElements() != BCVT.getVectorNumElements())
|
||||
BCNumEltsChanged = true;
|
||||
InVec = InVec.getOperand(0);
|
||||
EVT = BCVT.getVectorElementType();
|
||||
NewLoad = true;
|
||||
@ -4908,6 +4910,11 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
// (vextract (vector_shuffle (load $addr), v2, <1, u, u, u>), 1)
|
||||
// =>
|
||||
// (load $addr+1*size)
|
||||
|
||||
// If the bit convert changed the number of elements, it is unsafe
|
||||
// to examine the mask.
|
||||
if (BCNumEltsChanged)
|
||||
return SDValue();
|
||||
unsigned Idx = cast<ConstantSDNode>(InVec.getOperand(2).
|
||||
getOperand(Elt))->getZExtValue();
|
||||
unsigned NumElems = InVec.getOperand(2).getNumOperands();
|
||||
|
Loading…
Reference in New Issue
Block a user