[PowerPC] Remove extend between shift and and
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 5 Jul 2023 20:32:49 +0000 (16:32 -0400)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 5 Jul 2023 20:33:07 +0000 (16:33 -0400)
commita57236de4eb8f38b4201647b10146941cbbb5c0b
tree24bea4b535d45f55aada79bd2e276ec90766d4b8
parentb0ec18a3d10c46b3e483862a4c3ef31196869e0f
[PowerPC] Remove extend between shift and and

The SDAG will sometimes insert an extend between
the shift and an and (immediate) even though the
immediate is narrower than the narrow size.
This does not allow us to produce a rotate
instruction (such as rlwinm).
This patch just adds a combine to move the extend
onto the and.

Differential revision: https://reviews.llvm.org/D152911
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/and-extend-combine.ll [new file with mode: 0644]