[RISCV][InsertVSETVLI] Rewrite scalar insert forward rule in terms of demanded fields
authorPhilip Reames <preames@rivosinc.com>
Tue, 3 Jan 2023 22:17:33 +0000 (14:17 -0800)
committerPhilip Reames <listmail@philipreames.com>
Tue, 3 Jan 2023 22:19:52 +0000 (14:19 -0800)
commit460c1bd3440ebf5a601f643e992e3a0ad3471167
treeb6aa1f238a34f4a09f8a3024a6c99938caa6d5b8
parent2a2b9544346e05731c5c83df4fca87b0e8c461b3
[RISCV][InsertVSETVLI] Rewrite scalar insert forward rule in terms of demanded fields

This is mostly geared at consolidating logic into one form to reduce code duplication, but also has the effect of being a slight generalization. Since these operations aren't masked, we can ignore the mask policy bit when deciding on compatibility. The previous code was overly strict in checking that both policy bits matched.

Note: There's a slight difference from the reviewed version.  The reviewed version was based on a local revision which included the isCompatible change to only check AVL if VL is used.  I apparently never landed that change, and while functional, the functional change isn't visible without this one.  I chose to role the extra change into this patch.

Differential Revision: https://reviews.llvm.org/D140147
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll