[PATCH] D47725: [SelectionDAG] Create rotates more aggressively, provide default expansion

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 11:30:11 PDT 2018


efriedma added a comment.

Please split ReassociateOrForRotate into a separate patch; it's conceptually separate and likely to affect other targets.



================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3929
+                             DAG.getNode(ShOpc, dl, ResVT, Op0, Op1),
+                             DAG.getNode(HsOpc, dl, ResVT, Op0, Sub));
+    Results.push_back(Or);
----------------
This lowering is wrong (consider c==0, c==64). Maybe `(or (shl x, (and c, w-1), (srl x, (and (sub 0, c), w-1))` instead?


Repository:
  rL LLVM

https://reviews.llvm.org/D47725





More information about the llvm-commits mailing list