[PATCH] D92554: [SVE] Fix crashes with inline assembly

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 03:32:29 PST 2020


sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7418
+      uint64_t VTSize = VT.getFixedSizeInBits();
+      if (VTSize == 16)
         return std::make_pair(0U, &AArch64::FPR16RegClass);
----------------
nit: is it worth rewriting this to:

  TypeSize VTSize = VT.getSizeInBits();
  if (VTSize == TypeSize::getScalable(1))
    return ...
  if (VTSize == TypeSize::getFixed(16))
    return ...
  if (VTSize == TypeSize::getFixed(32))
    return ...

  if (VT.isScalableVector())
    return std::make_pair(0U, nullptr);
  break;


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7448
     if (PC != PredicateConstraint::Invalid) {
-      assert(VT.isScalableVector());
-      bool restricted = (PC == PredicateConstraint::Upl);
-      return restricted ? std::make_pair(0U, &AArch64::PPR_3bRegClass)
+      if (VT.isScalableVector() && VT.getVectorElementType() == MVT::i1) {
+        bool restricted = (PC == PredicateConstraint::Upl);
----------------
nit:

  if (!VT.isScalableVector() || VT.getVectorElementType() != MVT::i1)
    return std::make_pair(0U, nullptr);
  bool restricted = (PC == PredicateConstraint::Upl);
  return restricted ? std::make_pair(0U, &AArch64::PPR_3bRegClass)
                    : std::make_pair(0U, &AArch64::PPRRegClass);

(that saves having to indent the block)


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

https://reviews.llvm.org/D92554



More information about the llvm-commits mailing list