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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 3 10:22:33 PDT 2018


RKSimon added a reviewer: RKSimon.
RKSimon 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.
----------------
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.
```


https://reviews.llvm.org/D50091





More information about the llvm-commits mailing list