[PowerPC] when folding rlwinm+rlwinm. to andi., we should use first rlwinm
authorZheng Chen <czhengsz@cn.ibm.com>
Thu, 9 Jan 2020 01:54:15 +0000 (20:54 -0500)
committerZheng Chen <czhengsz@cn.ibm.com>
Thu, 9 Jan 2020 01:59:08 +0000 (20:59 -0500)
commit26ba160d47220a0bce75b1f491bf6e262edf69fa
tree4478701a3b6d162d02202f2450efdd62a7b02468
parent338a601612ca36e112b14f622eb310985b93192a
[PowerPC] when folding rlwinm+rlwinm. to andi., we should use first rlwinm
input reg.

%2:gprc = RLWINM %1:gprc, 27, 5, 10
%3:gprc = RLWINM_rec %2:gprc, 8, 5, 10, implicit-def $cr0

==>

%3:gprc = ANDI_rec %1, 0, implicit-def $cr0

we should use %1 instead of %2 as ANDI_rec input.

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D71885
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
llvm/test/CodeGen/PowerPC/fold-rlwinm.mir