[PATCH] D71829: [PowerPC] Exploit the rlwinm instructions for "and" with constant.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 25 19:56:35 PST 2019


shchenz added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4456
+    // using "and" instruction. Try to exploit it with rotate mask instructions.
+    if (isRunOfOnes64(Imm64, MB, ME)) {
+      if (MB >= 32 && MB <= ME) {
----------------
Seems if you only consider MB>=32  && MB<=ME case, i think current isRunOfOnes for type i32 should match your requirement? Before call isRunOfOnes() check whether Imm64 can be represented by i32?


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4457
+    if (isRunOfOnes64(Imm64, MB, ME)) {
+      if (MB >= 32 && MB <= ME) {
+        //                MB  ME
----------------
for ` and reg, 0xffffffffffff00ffULL`, it should be replaced by one single rlwinm instruction, seems it is not handled here?


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

https://reviews.llvm.org/D71829





More information about the llvm-commits mailing list