[llvm] [RISCV] Move RISCVInsertVSETVLI to after phi elimination (PR #91440)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 11:47:08 PDT 2024


================
@@ -1244,10 +1244,10 @@ define <vscale x 16 x i64> @vp_ctlz_nxv16i64(<vscale x 16 x i64> %va, <vscale x
 ; CHECK-NEXT:    sltu a3, a0, a2
 ; CHECK-NEXT:    addi a3, a3, -1
 ; CHECK-NEXT:    and a2, a3, a2
+; CHECK-NEXT:    fsrmi a3, 1
----------------
preames wrote:

There's an interesting test diff here.  Placing the vsetvli inside the frm preserve region (read, and later writeback) causes slightly higher register pressure.

I think this is safely ignorable, but if we cared, we could heuristically move a vsetvli which kills it's register AVL operand backwards over previous instructions which are don't care with respect to VL/VTYPE.  

https://github.com/llvm/llvm-project/pull/91440


More information about the llvm-commits mailing list