@@ -13939,78 +13939,7 @@ static SDValue performExtendCombine(SDNode *N,
13939
13939
13940
13940
return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), N->getValueType(0), NewABD);
13941
13941
}
13942
-
13943
- // This is effectively a custom type legalization for AArch64.
13944
- //
13945
- // Type legalization will split an extend of a small, legal, type to a larger
13946
- // illegal type by first splitting the destination type, often creating
13947
- // illegal source types, which then get legalized in isel-confusing ways,
13948
- // leading to really terrible codegen. E.g.,
13949
- // %result = v8i32 sext v8i8 %value
13950
- // becomes
13951
- // %losrc = extract_subreg %value, ...
13952
- // %hisrc = extract_subreg %value, ...
13953
- // %lo = v4i32 sext v4i8 %losrc
13954
- // %hi = v4i32 sext v4i8 %hisrc
13955
- // Things go rapidly downhill from there.
13956
- //
13957
- // For AArch64, the [sz]ext vector instructions can only go up one element
13958
- // size, so we can, e.g., extend from i8 to i16, but to go from i8 to i32
13959
- // take two instructions.
13960
- //
13961
- // This implies that the most efficient way to do the extend from v8i8
13962
- // to two v4i32 values is to first extend the v8i8 to v8i16, then do
13963
- // the normal splitting to happen for the v8i16->v8i32.
13964
-
13965
- // This is pre-legalization to catch some cases where the default
13966
- // type legalization will create ill-tempered code.
13967
- if (!DCI.isBeforeLegalizeOps())
13968
- return SDValue();
13969
-
13970
- // We're only interested in cleaning things up for non-legal vector types
13971
- // here. If both the source and destination are legal, things will just
13972
- // work naturally without any fiddling.
13973
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
13974
- EVT ResVT = N->getValueType(0);
13975
- if (!ResVT.isVector() || TLI.isTypeLegal(ResVT))
13976
- return SDValue();
13977
- // If the vector type isn't a simple VT, it's beyond the scope of what
13978
- // we're worried about here. Let legalization do its thing and hope for
13979
- // the best.
13980
- SDValue Src = N->getOperand(0);
13981
- EVT SrcVT = Src->getValueType(0);
13982
- if (!ResVT.isSimple() || !SrcVT.isSimple())
13983
- return SDValue();
13984
-
13985
- // If the source VT is a 64-bit fixed or scalable vector, we can play games
13986
- // and get the better results we want.
13987
- if (SrcVT.getSizeInBits().getKnownMinSize() != 64)
13988
- return SDValue();
13989
-
13990
- unsigned SrcEltSize = SrcVT.getScalarSizeInBits();
13991
- ElementCount SrcEC = SrcVT.getVectorElementCount();
13992
- SrcVT = MVT::getVectorVT(MVT::getIntegerVT(SrcEltSize * 2), SrcEC);
13993
- SDLoc DL(N);
13994
- Src = DAG.getNode(N->getOpcode(), DL, SrcVT, Src);
13995
-
13996
- // Now split the rest of the operation into two halves, each with a 64
13997
- // bit source.
13998
- EVT LoVT, HiVT;
13999
- SDValue Lo, Hi;
14000
- LoVT = HiVT = ResVT.getHalfNumVectorElementsVT(*DAG.getContext());
14001
-
14002
- EVT InNVT = EVT::getVectorVT(*DAG.getContext(), SrcVT.getVectorElementType(),
14003
- LoVT.getVectorElementCount());
14004
- Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, InNVT, Src,
14005
- DAG.getConstant(0, DL, MVT::i64));
14006
- Hi = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, InNVT, Src,
14007
- DAG.getConstant(InNVT.getVectorMinNumElements(), DL, MVT::i64));
14008
- Lo = DAG.getNode(N->getOpcode(), DL, LoVT, Lo);
14009
- Hi = DAG.getNode(N->getOpcode(), DL, HiVT, Hi);
14010
-
14011
- // Now combine the parts back together so we still have a single result
14012
- // like the combiner expects.
14013
- return DAG.getNode(ISD::CONCAT_VECTORS, DL, ResVT, Lo, Hi);
13942
+ return SDValue();
14014
13943
}
14015
13944
14016
13945
static SDValue splitStoreSplat(SelectionDAG &DAG, StoreSDNode &St,
0 commit comments