[PATCH] D50091: [SelectionDAG] try harder to convert funnel shift to rotate

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 5 09:01:06 PDT 2018


spatel added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5714
+      RotateOpcode = IsFSHL ? ISD::ROTR : ISD::ROTL;
+      if (TLI.isOperationLegal(RotateOpcode, VT)) {
+        // Negate the shift amount because it is safe to ignore the high bits.
----------------
RKSimon wrote:
> kparzysz wrote:
> > Can this be legal-or-custom (and same at line 5707)?
> see the TODO above:
> ```
> // TODO: This should also be done if the operation is custom, but we have
> // to make sure targets are handling the modulo shift amount as expected.
> ```
To add to Simon’s answer, there are known issues with x86 vector lowering discussed in:
https://bugs.llvm.org/show_bug.cgi?id=38243

...so there are many steps left towards standardizing on these intrinsics, but this small one is hopefully ok as-is.


https://reviews.llvm.org/D50091





More information about the llvm-commits mailing list