[PATCH] D80640: [CodeGen][SVE] Calculate correct type legalization for scalable vectors.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 16:23:22 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:189
 class TargetLoweringBase {
+  friend class AArch64SelectionDAGTest;
 public:
----------------
getTypeAction() and getTypeToTransformTo() are public; the unittest can use those APIs.


================
Comment at: llvm/lib/CodeGen/TargetLoweringBase.cpp:941
+  if (VT.getVectorElementCount() == ElementCount(1, true))
+    llvm_unreachable("Cannot legalize this vector");
+
----------------
report_fatal_error, and please move this up to just after the NumElts.isOne() check.  (The `EltVT.isInteger()` code also assumes the element count can be divided by two.)


================
Comment at: llvm/lib/CodeGen/TargetLoweringBase.cpp:1358
+            // that don't support scalable vectors can't lower them at all and
+            // end up here.
       } else {
----------------
We probably want a new LegalizeTypeAction kind to represent this.  I guess just leaving it TypeLegal isn't too terrible for now, though.


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

https://reviews.llvm.org/D80640





More information about the llvm-commits mailing list