[llvm] aad360d - [RISCV] Add EmitPriority=0 to Zcb load/store aliases with no immediate offset.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 09:06:00 PDT 2023


Author: Craig Topper
Date: 2023-07-27T09:05:50-07:00
New Revision: aad360d671f068736ee6d532c939c99ecfbe7c63

URL: https://github.com/llvm/llvm-project/commit/aad360d671f068736ee6d532c939c99ecfbe7c63
DIFF: https://github.com/llvm/llvm-project/commit/aad360d671f068736ee6d532c939c99ecfbe7c63.diff

LOG: [RISCV] Add EmitPriority=0 to Zcb load/store aliases with no immediate offset.

We only want to be able to parse a missing offset. We don't want
to print with no offset.

This matches the non-compressed form of these aliases.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInstrInfoZc.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
index 6687343086da61..b6f1ec7ca74e48 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
@@ -285,9 +285,9 @@ def : CompressPat<(SH GPRC:$rs2, GPRCMem:$rs1, uimm2_lsb0:$imm),
 //===----------------------------------------------------------------------===//
 
 let Predicates = [HasStdExtZcb] in {
-def : InstAlias<"c.lbu $rd, (${rs1})",(C_LBU GPRC:$rd, GPRC:$rs1, 0)>;
-def : InstAlias<"c.lhu $rd, (${rs1})",(C_LHU GPRC:$rd, GPRC:$rs1, 0)>;
-def : InstAlias<"c.lh $rd, (${rs1})", (C_LH GPRC:$rd, GPRC:$rs1, 0)>;
-def : InstAlias<"c.sb $rd, (${rs1})", (C_SB GPRC:$rd, GPRC:$rs1, 0)>;
-def : InstAlias<"c.sh $rd, (${rs1})", (C_SH GPRC:$rd, GPRC:$rs1, 0)>;
+def : InstAlias<"c.lbu $rd, (${rs1})",(C_LBU GPRC:$rd, GPRC:$rs1, 0), 0>;
+def : InstAlias<"c.lhu $rd, (${rs1})",(C_LHU GPRC:$rd, GPRC:$rs1, 0), 0>;
+def : InstAlias<"c.lh $rd, (${rs1})", (C_LH GPRC:$rd, GPRC:$rs1, 0), 0>;
+def : InstAlias<"c.sb $rd, (${rs1})", (C_SB GPRC:$rd, GPRC:$rs1, 0), 0>;
+def : InstAlias<"c.sh $rd, (${rs1})", (C_SH GPRC:$rd, GPRC:$rs1, 0), 0>;
 }


        


More information about the llvm-commits mailing list