diff options
| author | QingShan Zhang <qshanz@cn.ibm.com> | 2019-12-30 03:18:31 +0000 |
|---|---|---|
| committer | QingShan Zhang <qshanz@cn.ibm.com> | 2019-12-30 03:18:31 +0000 |
| commit | 874a8004f93538a0c9b335a7e1e34d80b57ebccd (patch) | |
| tree | fbb8f2abcc16f85bc4092691d58d04e592f96ba6 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
| parent | 266cd7717c8126213a7560d26da5495053be90c0 (diff) | |
| download | bcm5719-llvm-874a8004f93538a0c9b335a7e1e34d80b57ebccd.tar.gz bcm5719-llvm-874a8004f93538a0c9b335a7e1e34d80b57ebccd.zip | |
[PowerPC] Exploit the rlwinm instructions for "and" with constant
For now, PowerPC will using several instructions to get the constant and "and" it with the following case:
define i32 @test1(i32 %a) {
%and = and i32 %a, -2
ret i32 %and
}
However, we could exploit it with the rotate mask instructions.
MB ME
+----------------------+
|xxxxxxxxxxx00011111000|
+----------------------+
0 32 64
Notice that, we can only do it if the MB is larger than 32 and MB <= ME as
RLWINM will replace the content of [0 - 32) with [32 - 64) even we didn't rotate it.
Differential Revision: https://reviews.llvm.org/D71829
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
0 files changed, 0 insertions, 0 deletions

