[PowerPC] Optimize compares fed by ANDISo
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 18 Sep 2018 13:21:58 +0000 (13:21 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 18 Sep 2018 13:21:58 +0000 (13:21 +0000)
commit6a39d32e663ae1c19b4f01b191433f5c0f0cfc45
tree099cc9589fd582e81273db574a5baefd02eeb5d2
parent83d7414e196ae9e7a6c1721c6356b5f2e8dfc919
[PowerPC] Optimize compares fed by ANDISo

Both ANDIo and ANDISo (and the 64-bit versions) are record-form instructions.
When optimizing compares, we handle the former in order to eliminate the compare
instruction but not the latter. This patch just adds the latter to the set of
instructions we optimize.
The reason these instructions need to be handled separately is that they are not
part of the RecFormRel map (since they don't have a non-record-form). The
missing "and-immediate-shifted" is just an oversight in the initial
implementation.

Differential revision: https://reviews.llvm.org/D51353

llvm-svn: 342472
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
llvm/test/CodeGen/PowerPC/optimize-andiso.ll [new file with mode: 0644]