[AArch64][SVE] Use more flag-setting instructions
authorCullen Rhodes <cullen.rhodes@arm.com>
Tue, 25 Oct 2022 08:29:09 +0000 (08:29 +0000)
committerCullen Rhodes <cullen.rhodes@arm.com>
Tue, 25 Oct 2022 09:02:21 +0000 (09:02 +0000)
commit1e02a29e4753ef70d7ce0ad90b7e4f29f1223006
treeb29efaf20daebf7216770fd524cd82c16651a17c
parent5621caeb8248a66c7d52b8148426530a0b559d86
[AArch64][SVE] Use more flag-setting instructions

If OP in PTEST(PG, OP(PG, ...)) has a flag-setting variant change the
opcode so the PTEST becomes redundant. This patch extends this existing
optimization in AArch64::optimizePTestInstr to cover all flag-setting
opcodes.

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D136083
llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.h
llvm/test/CodeGen/AArch64/sve-int-pred-reduce.ll
llvm/test/CodeGen/AArch64/sve-ptest-removal-brk.ll
llvm/test/CodeGen/AArch64/sve-ptest-removal-log.ll
llvm/test/CodeGen/AArch64/sve-ptest-removal-ptrue.ll
llvm/test/CodeGen/AArch64/sve-split-int-pred-reduce.ll
llvm/test/CodeGen/AArch64/sve-vecreduce-fold.ll