@@ -1114,12 +1114,15 @@ let RecomputePerFunction = 1 in {
11141114
11151115 def SLSBLRMitigation : Predicate<[{ MF->getSubtarget<AArch64Subtarget>().hardenSlsBlr() }]>;
11161116 def NoSLSBLRMitigation : Predicate<[{ !MF->getSubtarget<AArch64Subtarget>().hardenSlsBlr() }]>;
1117+
1118+ defvar GISelLegalizedCheck = "(!MF->getProperties().hasProperty(MachineFunctionProperties::Property::FailedISel) && MF->getProperties().hasProperty(MachineFunctionProperties::Property::Legalized))";
1119+ def OnlyGISel : Predicate<GISelLegalizedCheck>;
11171120 // Toggles patterns which aren't beneficial in GlobalISel when we aren't
11181121 // optimizing. This allows us to selectively use patterns without impacting
11191122 // SelectionDAG's behaviour.
11201123 // FIXME: One day there will probably be a nicer way to check for this, but
11211124 // today is not that day.
1122- def OptimizedGISelOrOtherSelector : Predicate<"!MF->getFunction().hasOptNone() || MF->getProperties().hasProperty(MachineFunctionProperties::Property::FailedISel) || !MF->getProperties().hasProperty(MachineFunctionProperties::Property::Legalized)" >;
1125+ def OptimizedGISelOrOtherSelector : Predicate<!strconcat( "!MF->getFunction().hasOptNone() || !", GISelLegalizedCheck) >;
11231126}
11241127
11251128include "AArch64InstrFormats.td"
@@ -4036,6 +4039,11 @@ multiclass LoadInsertPatterns<SDPatternOperator LoadOp, ValueType VT, ValueType
40364039 ROXLoadInst, ro, Addr, UnscaledAddr, AddrImm, SubReg>;
40374040}
40384041
4042+ let Predicates = [OnlyGISel] in {
4043+ defm : LoadInsertPatterns<load, v16i8, v8i8, nxv16i8, i8,
4044+ LDRBui, LDURBi, LDRBroW, LDRBroX,
4045+ ro8, am_indexed8, am_unscaled8, uimm12s1, bsub>;
4046+ }
40394047defm : LoadInsertPatterns<extloadi8, v16i8, v8i8, nxv16i8, i32,
40404048 LDRBui, LDURBi, LDRBroW, LDRBroX,
40414049 ro8, am_indexed8, am_unscaled8, uimm12s1, bsub>;
@@ -7330,6 +7338,9 @@ defm : Neon_INS_elt_pattern<v8bf16, v4bf16, nxv8bf16, bf16, VectorIndexH, INSvi1
73307338defm : Neon_INS_elt_pattern<v4f32, v2f32, nxv4f32, f32, VectorIndexS, INSvi32lane, DUPi32, ssub>;
73317339defm : Neon_INS_elt_pattern<v2f64, v1f64, nxv2f64, f64, VectorIndexD, INSvi64lane, DUPi64, dsub>;
73327340
7341+ let Predicates = [OnlyGISel] in {
7342+ defm : Neon_INS_elt_pattern<v16i8, v8i8, nxv16i8, i8, VectorIndexB, INSvi8lane, DUPi8, bsub>;
7343+ }
73337344defm : Neon_INS_elt_pattern<v16i8, v8i8, nxv16i8, i32, VectorIndexB, INSvi8lane, DUPi8, bsub>;
73347345defm : Neon_INS_elt_pattern<v8i16, v4i16, nxv8i16, i32, VectorIndexH, INSvi16lane, DUPi16, hsub>;
73357346defm : Neon_INS_elt_pattern<v4i32, v2i32, nxv4i32, i32, VectorIndexS, INSvi32lane, DUPi32, ssub>;
@@ -8752,6 +8763,9 @@ class Ld1Lane128Pat<SDPatternOperator scalar_load, Operand VecIndex,
87528763 (STy (scalar_load GPR64sp:$Rn)), (i64 VecIndex:$idx)),
87538764 (LD1 VecListOne128:$Rd, VecIndex:$idx, GPR64sp:$Rn)>;
87548765
8766+ let Predicates = [OnlyGISel] in {
8767+ def : Ld1Lane128Pat<load, VectorIndexB, v16i8, i8, LD1i8>;
8768+ }
87558769def : Ld1Lane128Pat<extloadi8, VectorIndexB, v16i8, i32, LD1i8>;
87568770def : Ld1Lane128Pat<extloadi16, VectorIndexH, v8i16, i32, LD1i16>;
87578771def : Ld1Lane128Pat<load, VectorIndexS, v4i32, i32, LD1i32>;
@@ -8825,6 +8839,9 @@ class Ld1Lane64Pat<SDPatternOperator scalar_load, Operand VecIndex,
88258839 VecIndex:$idx, GPR64sp:$Rn),
88268840 dsub)>;
88278841
8842+ let Predicates = [OnlyGISel] in {
8843+ def : Ld1Lane64Pat<load, VectorIndexB, v8i8, i8, LD1i8>;
8844+ }
88288845def : Ld1Lane64Pat<extloadi8, VectorIndexB, v8i8, i32, LD1i8>;
88298846def : Ld1Lane64Pat<extloadi16, VectorIndexH, v4i16, i32, LD1i16>;
88308847def : Ld1Lane64Pat<load, VectorIndexS, v2i32, i32, LD1i32>;
0 commit comments