[PATCH] D67549: [IntrinsicEmitter] Add overloaded types for SVE intrinsics (Subdivide2 & Subdivide4)

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 05:36:42 PDT 2019


kmclaughlin added a comment.

Thanks for reviewing this patch, @rovka and @sdesmalen!



================
Comment at: include/llvm/IR/Intrinsics.h:130
+             Kind == PtrToElt || Kind == VecElementArgument ||
+             Kind == Subdivide2Argument || Kind == Subdivide4Argument);
       return Argument_Info >> 3;
----------------
rovka wrote:
> Not directly related to your change: Is there a reason why VecOfAnyPtrsToElt isn't in this assert? If not, maybe this is a good time to add a First/LastArgumentKind and just check that Kind is in the range.
I think it's probably best not to include VecOfAnyPtrsToElt here as it was removed from the assert when the functions //getOverloadArgNumber// and //getRefArgNumber// below were added (these should be used instead of getArgumentNumber in this case).


================
Comment at: lib/IR/Function.cpp:1312
+    case IITDescriptor::Subdivide4Argument: {
+      // This may only be used when referring to a previous vector argument.
+      if (D.getArgumentNumber() >= ArgTys.size())
----------------
rovka wrote:
> Can you share this code? Either a small helper or a fallthrough with a repeat check on D.Kind to get the number of subdivisions would work.
This code is now shared, as is the code to handle Subdivide2Argument & Subdivide4Argument in Function.cpp above.


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

https://reviews.llvm.org/D67549





More information about the llvm-commits mailing list