[NFC][RISCV] Use concise way to describe load/store instructions.
authorHsiangkai Wang <kai.wang@sifive.com>
Thu, 18 Feb 2021 01:33:25 +0000 (09:33 +0800)
committerHsiangkai Wang <kai.wang@sifive.com>
Thu, 18 Feb 2021 14:17:00 +0000 (22:17 +0800)
Differential Revision: https://reviews.llvm.org/D96923

llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td

index 2c845af..a98bb0f 100644 (file)
@@ -71,15 +71,9 @@ multiclass VPatUSLoadStoreWholeVRSDNode<LLVMType type,
                                         VReg reg_class>
 {
   defvar load_instr =
-    !cond(!eq(vlmul.value, V_M1.value): !cast<Instruction>("VL1RE"#sew#"_V"),
-          !eq(vlmul.value, V_M2.value): !cast<Instruction>("VL2RE"#sew#"_V"),
-          !eq(vlmul.value, V_M4.value): !cast<Instruction>("VL4RE"#sew#"_V"),
-          !eq(vlmul.value, V_M8.value): !cast<Instruction>("VL8RE"#sew#"_V"));
+    !cast<Instruction>("VL"#!substr(vlmul.MX, 1)#"RE"#sew#"_V");
   defvar store_instr =
-    !cond(!eq(vlmul.value, V_M1.value): VS1R_V,
-          !eq(vlmul.value, V_M2.value): VS2R_V,
-          !eq(vlmul.value, V_M4.value): VS4R_V,
-          !eq(vlmul.value, V_M8.value): VS8R_V);
+    !cast<Instruction>("VS"#!substr(vlmul.MX, 1)#"R_V");
 
   // Load
   def : Pat<(type (load BaseAddr:$rs1)),