[RISCV] Fold vector binary operatrion into select with identity constant.
authorjacquesguan <Jianjian.Guan@streamcomputing.com>
Wed, 21 Sep 2022 07:51:18 +0000 (15:51 +0800)
committerjacquesguan <Jianjian.Guan@streamcomputing.com>
Tue, 6 Dec 2022 03:19:31 +0000 (11:19 +0800)
commitf7a46aa8fbc261f2c399f192902bfccce57f35e7
treecd72419314a508152f1f17650c5bf3dbf66e4c25
parenta8ccf0ef5b7641899aae2d3f12a68d22ddbf5af8
[RISCV] Fold vector binary operatrion into select with identity constant.

This patch implements shouldFoldSelectWithIdentityConstant for RISCV. It would try to generate vmerge after the binary instruction and let them folded to maksed instruction later.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D131551
13 files changed:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/test/CodeGen/RISCV/rvv/vadd-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vand-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vfadd-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vfsub-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vmul-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vor-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vshl-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vsra-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vsrl-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vsub-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/vxor-sdnode.ll