[RFC] Named shuffle intrinsics

Joe,

   Last January, an RFC was posted for this very use case: http://lists.llvm.org/pipermail/llvm-dev/2020-January/138762.html. In that RFC, the proposal was to extend the actual shufflevector instruction to have a "named shuffles" mode. I'm curious, why have you chosen to go with intrinsics for this RFC rather than use an approach similar to the previous RFC?

Thanks,
   Christopher Tetreault

Hi Christopher,

Thanks for your response! I am aware of Eli's RFC. There is definitely some overlap between the two proposals, but I think having named intrinsics to represent common vector shuffles is preferable for our needs.

The original RFC is much wider in scope and more extensive in the changes that are required. We're trying to solve an immediate problem here: expressing shuffles on scalable vectors. The proof-of-concept on Phabricator currently places the intrinsics into the `llvm.experimental` namespace, so if we want to adopt a different way forward in the future that's certainly possible.

Thanks!
Joe

Joe,

   I suppose my concern is that if we take these paths of least resistance, we'll never get to the goal of scalable vectors being first class citizens. If the goal is to get these experimental intrinsics in now in order to get work done, and to upgrade shufflevector to support these use cases in the long term rather than moving these intrinsics out of the experimental namespace, then I suppose that's fine.

Thanks,
   Christopher Tetreault

Hi Christopher,

I can definitely appreciate what you are saying. For now, though, these intrinsics satisfy our immediate concerns. That said, I am not opposed to removing these intrinsics and following a different approach (such as Eli's proposal) in the future if it is needed.

Thanks!
Joe