[PATCH] D60402: [PowerPC] Collapse RLDICL/RLDICR into RLDIC when possible

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 05:27:33 PDT 2019


nemanjai created this revision.
nemanjai added reviewers: hfinkel, stefanp, jsji.
Herald added a subscriber: kbarton.
Herald added a project: LLVM.

Generally speaking, we lower to an optimal rotate sequence for nodes visible in the SDAG. However, there are instances where the two rotates are not visible at ISEL time - most notably those in a very common sequence when lowering `switch` statements to jump tables.
A common situation is a `switch` on a 32-bit integer. This value has to have the upper 32 bits cleared and because jump table offsets are word offsets, the value needs to be shifted left by 2 bits. We currently emit the clear and the left shift as two separate instructions, but this is not needed as we can lower it to a single `RLDIC`.
This patch just cleans that up.


Repository:
  rL LLVM

https://reviews.llvm.org/D60402

Files:
  lib/Target/PowerPC/PPCMIPeephole.cpp
  test/CodeGen/PowerPC/collapse-rotates.mir
  test/CodeGen/PowerPC/jump-tables-collapse-rotate.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60402.194118.patch
Type: text/x-patch
Size: 8664 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190408/72900c8f/attachment.bin>


More information about the llvm-commits mailing list