[PATCH] D133433: [AArch64]: Force generating code compatible to streaming mode

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 16:21:59 PDT 2022


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:1397-1405
+    if (Subtarget->forceStreamingCompatibleSVE()) {
+      for (MVT VT : {MVT::v8i8, MVT::v16i8, MVT::v4i16, MVT::v8i16, MVT::v2i32,
+                     MVT::v4i32, MVT::v1i64, MVT::v2i64})
+        addTypeForStreamingSVE(VT);
+
+      for (MVT VT : {MVT::v4f16, MVT::v8f16, MVT::v2f32, MVT::v4f32, MVT::v1f64,
+                     MVT::v2f64})
----------------
I understand why this code block and `addTypeForStreamingSVE()` exist, but given they don't do anything within this patch anymore I think they're best moved into one of your other patches.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:5775-5776
   case ISD::LOAD:
-    if (useSVEForFixedLengthVectorVT(Op.getValueType()))
+    if (useSVEForFixedLengthVectorVT(Op.getValueType(),
+                                     Subtarget->forceStreamingCompatibleSVE()))
       return LowerFixedLengthVectorLoadToSVE(Op, DAG);
----------------
Is this still necessary now that you're no longer custom lowering `ISD::LOAD` for NEON sized vectors?


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.td:7138
 // scalar_to_vector + insert_subvector instead of insert_vector_elt.
-class Ld1Lane128FirstElm<ValueType ResultTy, ValueType VecTy,
-                        SDPatternOperator ExtLoad, Instruction LD1>
-  : Pat<(ResultTy (scalar_to_vector (i32 (ExtLoad GPR64sp:$Rn)))),
-          (ResultTy (EXTRACT_SUBREG
-            (LD1 (VecTy (IMPLICIT_DEF)), 0, GPR64sp:$Rn), dsub))>;
-
-def : Ld1Lane128FirstElm<v2i32, v8i16, extloadi16, LD1i16>;
-def : Ld1Lane128FirstElm<v2i32, v16i8, extloadi8, LD1i8>;
-def : Ld1Lane128FirstElm<v4i16, v16i8, extloadi8, LD1i8>;
+let Predicates = [IsStreamingCompatibleSVEDisabled] in {
+  class Ld1Lane128FirstElm<ValueType ResultTy, ValueType VecTy,
----------------
Up to you but personally I think `NotInStreamingSVEMode` reads better.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133433/new/

https://reviews.llvm.org/D133433



More information about the llvm-commits mailing list