Skip to content

Commit a8aad7b

Browse files
committed
[RISCV] Select Zvkb VANDN for shorter constant loading sequences
This extends PR llvm#120221 to vector instructions.
1 parent 21704a6 commit a8aad7b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,13 @@ foreach vti = AllIntegerVectors in {
624624
vti.RegClass:$rs2,
625625
vti.ScalarRegClass:$rs1,
626626
vti.AVL, vti.Log2SEW, TA_MA)>;
627+
def : Pat<(vti.Vector (and (riscv_splat_vector invLogicImm:$rs1),
628+
vti.RegClass:$rs2)),
629+
(!cast<Instruction>("PseudoVANDN_VX_"#vti.LMul.MX)
630+
(vti.Vector (IMPLICIT_DEF)),
631+
vti.RegClass:$rs2,
632+
invLogicImm:$rs1,
633+
vti.AVL, vti.Log2SEW, TA_MA)>;
627634
}
628635
}
629636

0 commit comments

Comments
 (0)