@@ -13883,78 +13883,7 @@ static SDValue performExtendCombine(SDNode *N,
13883
13883
13884
13884
return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), N->getValueType(0), NewABD);
13885
13885
}
13886
-
13887
- // This is effectively a custom type legalization for AArch64.
13888
- //
13889
- // Type legalization will split an extend of a small, legal, type to a larger
13890
- // illegal type by first splitting the destination type, often creating
13891
- // illegal source types, which then get legalized in isel-confusing ways,
13892
- // leading to really terrible codegen. E.g.,
13893
- // %result = v8i32 sext v8i8 %value
13894
- // becomes
13895
- // %losrc = extract_subreg %value, ...
13896
- // %hisrc = extract_subreg %value, ...
13897
- // %lo = v4i32 sext v4i8 %losrc
13898
- // %hi = v4i32 sext v4i8 %hisrc
13899
- // Things go rapidly downhill from there.
13900
- //
13901
- // For AArch64, the [sz]ext vector instructions can only go up one element
13902
- // size, so we can, e.g., extend from i8 to i16, but to go from i8 to i32
13903
- // take two instructions.
13904
- //
13905
- // This implies that the most efficient way to do the extend from v8i8
13906
- // to two v4i32 values is to first extend the v8i8 to v8i16, then do
13907
- // the normal splitting to happen for the v8i16->v8i32.
13908
-
13909
- // This is pre-legalization to catch some cases where the default
13910
- // type legalization will create ill-tempered code.
13911
- if (!DCI.isBeforeLegalizeOps())
13912
- return SDValue();
13913
-
13914
- // We're only interested in cleaning things up for non-legal vector types
13915
- // here. If both the source and destination are legal, things will just
13916
- // work naturally without any fiddling.
13917
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
13918
- EVT ResVT = N->getValueType(0);
13919
- if (!ResVT.isVector() || TLI.isTypeLegal(ResVT))
13920
- return SDValue();
13921
- // If the vector type isn't a simple VT, it's beyond the scope of what
13922
- // we're worried about here. Let legalization do its thing and hope for
13923
- // the best.
13924
- SDValue Src = N->getOperand(0);
13925
- EVT SrcVT = Src->getValueType(0);
13926
- if (!ResVT.isSimple() || !SrcVT.isSimple())
13927
- return SDValue();
13928
-
13929
- // If the source VT is a 64-bit fixed or scalable vector, we can play games
13930
- // and get the better results we want.
13931
- if (SrcVT.getSizeInBits().getKnownMinSize() != 64)
13932
- return SDValue();
13933
-
13934
- unsigned SrcEltSize = SrcVT.getScalarSizeInBits();
13935
- ElementCount SrcEC = SrcVT.getVectorElementCount();
13936
- SrcVT = MVT::getVectorVT(MVT::getIntegerVT(SrcEltSize * 2), SrcEC);
13937
- SDLoc DL(N);
13938
- Src = DAG.getNode(N->getOpcode(), DL, SrcVT, Src);
13939
-
13940
- // Now split the rest of the operation into two halves, each with a 64
13941
- // bit source.
13942
- EVT LoVT, HiVT;
13943
- SDValue Lo, Hi;
13944
- LoVT = HiVT = ResVT.getHalfNumVectorElementsVT(*DAG.getContext());
13945
-
13946
- EVT InNVT = EVT::getVectorVT(*DAG.getContext(), SrcVT.getVectorElementType(),
13947
- LoVT.getVectorElementCount());
13948
- Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, InNVT, Src,
13949
- DAG.getConstant(0, DL, MVT::i64));
13950
- Hi = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, InNVT, Src,
13951
- DAG.getConstant(InNVT.getVectorMinNumElements(), DL, MVT::i64));
13952
- Lo = DAG.getNode(N->getOpcode(), DL, LoVT, Lo);
13953
- Hi = DAG.getNode(N->getOpcode(), DL, HiVT, Hi);
13954
-
13955
- // Now combine the parts back together so we still have a single result
13956
- // like the combiner expects.
13957
- return DAG.getNode(ISD::CONCAT_VECTORS, DL, ResVT, Lo, Hi);
13886
+ return SDValue();
13958
13887
}
13959
13888
13960
13889
static SDValue splitStoreSplat(SelectionDAG &DAG, StoreSDNode &St,
0 commit comments