From a577d59db243c1be038f331e0057a37b777a4407 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 6 May 2021 11:21:46 -0700 Subject: [PATCH] [RISCV] Minor vector instruction tablegen cleanup. NFC Use result_type for the IMPLICIT_DEF in masked vector patterns. This doesn't matter today because result_type and op_type are always the same. Use multiclass inheritance to reduce repeated code. --- llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td | 12 ++---------- llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td | 14 ++++---------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td index dd426f1..3a7ed47 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td @@ -138,8 +138,7 @@ class VPatBinarySDNode_XI; -multiclass VPatBinarySDNode_VV_VX -{ +multiclass VPatBinarySDNode_VV_VX { foreach vti = AllIntegerVectors in { def : VPatBinarySDNode_VV multiclass VPatBinarySDNode_VV_VX_VI -{ + : VPatBinarySDNode_VV_VX { foreach vti = AllIntegerVectors in { - def : VPatBinarySDNode_VV; - def : VPatBinarySDNode_XI; def : VPatBinarySDNode_XI(instruction_name#"_VV_"# vlmul.MX#"_MASK") - (op_type (IMPLICIT_DEF)), + (result_type (IMPLICIT_DEF)), op_reg_class:$rs1, op_reg_class:$rs2, VMV0:$vm, GPR:$vl, sew)>; @@ -295,7 +295,7 @@ multiclass VPatBinaryVL_XI(instruction_name#_#suffix#_# vlmul.MX#"_MASK") - (vop_type (IMPLICIT_DEF)), + (result_type (IMPLICIT_DEF)), vop_reg_class:$rs1, xop_kind:$rs2, VMV0:$vm, GPR:$vl, sew)>; @@ -314,15 +314,9 @@ multiclass VPatBinaryVL_VV_VX { } multiclass VPatBinaryVL_VV_VX_VI { + Operand ImmType = simm5> + : VPatBinaryVL_VV_VX { foreach vti = AllIntegerVectors in { - defm : VPatBinaryVL_VV; - defm : VPatBinaryVL_XI; defm : VPatBinaryVL_XI