[PATCH] D123449: [AArch64][SelectionDAG] Refactor to support more scalable vector extending stores

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 9 03:12:40 PDT 2022


Allen created this revision.
Allen added reviewers: paulwalker-arm, david-arm, efriedma.
Herald added subscribers: ecnelises, hiraditya, kristof.beyls.
Herald added a project: All.
Allen requested review of this revision.
Herald added subscribers: llvm-commits, alextsao1999.
Herald added a project: LLVM.

Similar to D122281 <https://reviews.llvm.org/D122281>, we should firstly exclude all scalable vector extending
stores and then selectively enable those which we directly support.


https://reviews.llvm.org/D123449

Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp


Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -1217,7 +1217,7 @@
     // Firstly, exclude all scalable vector extending loads/truncating stores.
     for (MVT VT : MVT::integer_scalable_vector_valuetypes()) {
       for (MVT InnerVT : MVT::integer_scalable_vector_valuetypes()) {
-        // TODO: truncating stores should also be exclude
+        setTruncStoreAction(VT, InnerVT, Expand);
         setLoadExtAction(ISD::SEXTLOAD, VT, InnerVT, Expand);
         setLoadExtAction(ISD::ZEXTLOAD, VT, InnerVT, Expand);
         setLoadExtAction(ISD::EXTLOAD, VT, InnerVT, Expand);
@@ -1226,6 +1226,13 @@
 
     // Then, selectively enable those which we directly support.
     for (auto Op : {ISD::ZEXTLOAD, ISD::SEXTLOAD, ISD::EXTLOAD}) {
+      setTruncStoreAction(MVT::nxv2i64, MVT::nxv2i8, Legal);
+      setTruncStoreAction(MVT::nxv2i64, MVT::nxv2i16, Legal);
+      setTruncStoreAction(MVT::nxv2i64, MVT::nxv2i32, Legal);
+      setTruncStoreAction(MVT::nxv4i32, MVT::nxv4i8, Legal);
+      setTruncStoreAction(MVT::nxv4i32, MVT::nxv4i16, Legal);
+      setTruncStoreAction(MVT::nxv8i16, MVT::nxv8i8, Legal);
+
       setLoadExtAction(Op, MVT::nxv2i64, MVT::nxv2i8, Legal);
       setLoadExtAction(Op, MVT::nxv2i64, MVT::nxv2i16, Legal);
       setLoadExtAction(Op, MVT::nxv2i64, MVT::nxv2i32, Legal);
Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -7777,7 +7777,7 @@
   EVT StVT = ST->getMemoryVT();
 
   if (StVT.isScalableVector())
-    report_fatal_error("Cannot scalarize scalable vector stores");
+    return SDValue();
 
   // The type of the data we want to save
   EVT RegVT = Value.getValueType();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123449.421707.patch
Type: text/x-patch
Size: 1981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220409/2eec33e7/attachment.bin>


More information about the llvm-commits mailing list