[RISCV] DAG Combine vcpop and vfirst with VL=0 to li imm
authorChenbing Zheng <Chenbing.Zheng@streamcomputing.com>
Fri, 25 Feb 2022 06:44:25 +0000 (14:44 +0800)
committerChenbing Zheng <Chenbing.Zheng@streamcomputing.com>
Fri, 25 Feb 2022 06:44:25 +0000 (14:44 +0800)
commitb20e80aa590de1f006c2893ee53c9a89714ff276
treea6cb22a7058d38fc57cca7c42804f76162cafede
parent4e115b7d881136947c083e12f62010bc6b1d3f00
[RISCV] DAG Combine vcpop and vfirst with VL=0 to li imm

vcpop and vfirst are still useful when VL=0.
vcpop equivalents to li 0 and vfirst equivalents to li -1,
since no mask elements are active.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D120302
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/vcpop.ll
llvm/test/CodeGen/RISCV/rvv/vfirst.ll