@@ -1604,6 +1604,26 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1604
1604
setOperationAction(ISD::MSTORE, VT, Custom);
1605
1605
}
1606
1606
1607
+ if (EnablePartialReduceNodes) {
1608
+ for (MVT VT : MVT::integer_scalable_vector_valuetypes()) {
1609
+ for (MVT InnerVT : MVT::integer_scalable_vector_valuetypes()) {
1610
+ // 1. Set all combinations where a type is illegal to "Legal"
1611
+ // - These will be legalized to a legal type pair
1612
+ // - Avoid expanding them too early (or preventing folds)
1613
+ if (!isTypeLegal(VT) || !isTypeLegal(InnerVT)) {
1614
+ setPartialReduceMLAAction(VT, InnerVT, Legal);
1615
+ continue;
1616
+ }
1617
+ // 2. Set all legal combinations to "Expand"
1618
+ // - Not all of these can be lowered (via a Legal or Custom lowering).
1619
+ setPartialReduceMLAAction(VT, InnerVT, Expand);
1620
+ }
1621
+ }
1622
+ // 3. Mark known legal pairs as 'Legal' (these will expand to USDOT).
1623
+ setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv8i16, Legal);
1624
+ setPartialReduceMLAAction(MVT::nxv4i32, MVT::nxv16i8, Legal);
1625
+ }
1626
+
1607
1627
// Firstly, exclude all scalable vector extending loads/truncating stores,
1608
1628
// include both integer and floating scalable vector.
1609
1629
for (MVT VT : MVT::scalable_vector_valuetypes()) {
@@ -1856,6 +1876,14 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1856
1876
// Other pairs will default to 'Expand'.
1857
1877
setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv8i16, Legal);
1858
1878
setPartialReduceMLAAction(MVT::nxv4i32, MVT::nxv16i8, Legal);
1879
+
1880
+ setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv8i64, Custom);
1881
+ setPartialReduceMLAAction(MVT::nxv4i32, MVT::nxv16i32, Custom);
1882
+
1883
+ setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv4i64, Custom);
1884
+ setPartialReduceMLAAction(MVT::nxv4i32, MVT::nxv8i32, Custom);
1885
+ setPartialReduceMLAAction(MVT::nxv8i16, MVT::nxv16i16, Custom);
1886
+ setPartialReduceMLAAction(MVT::nxv16i8, MVT::nxv32i8, Custom);
1859
1887
}
1860
1888
1861
1889
// Handle operations that are only available in non-streaming SVE mode.
0 commit comments