[PowerPC] Exploit RLDIMI for OR with large immediates
authorQiu Chaofan <qiucofan@cn.ibm.com>
Fri, 17 Apr 2020 07:08:58 +0000 (15:08 +0800)
committerQiu Chaofan <qiucofan@cn.ibm.com>
Wed, 22 Apr 2020 06:16:52 +0000 (14:16 +0800)
commitc12722cde83212581d14a6fdd6a52ebed04ac4df
tree49f4767164c555b6aca8aae3a8ca34fd8dcfd146
parentdaadb4855399f27c8e5af18c3ae51169df4c6d5a
[PowerPC] Exploit RLDIMI for OR with large immediates

This patch exploits rldimi instruction for patterns like
`or %a, 0b000011110000`, which saves number of instructions when the
operand has only one use, compared with `li-ori-sldi-or`.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D77850
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
llvm/test/CodeGen/PowerPC/ori_imm32.ll
llvm/test/CodeGen/PowerPC/ori_imm64.ll