[llvm] [RISCV] Use MnemonicAlias for 'fssr' and 'frsr'. NFC (PR #131877)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 18 11:03:18 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/131877.diff


1 Files Affected:

- (modified) llvm/lib/Target/RISCV/RISCVInstrInfoF.td (+3-5) 


``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoF.td b/llvm/lib/Target/RISCV/RISCVInstrInfoF.td
index 04328151adf8e..97550381a6fb7 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoF.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoF.td
@@ -425,11 +425,9 @@ def : InstAlias<"frcsr $rd",      (CSRRS GPR:$rd, SysRegFCSR.Encoding, X0), 2>;
 def : InstAlias<"fscsr $rd, $rs", (CSRRW GPR:$rd, SysRegFCSR.Encoding, GPR:$rs)>;
 def : InstAlias<"fscsr $rs",      (CSRRW      X0, SysRegFCSR.Encoding, GPR:$rs), 2>;
 
-// frsr, fssr are obsolete aliases replaced by frcsr, fscsr, so give them
-// zero weight.
-def : InstAlias<"frsr $rd",       (CSRRS GPR:$rd, SysRegFCSR.Encoding, X0), 0>;
-def : InstAlias<"fssr $rd, $rs",  (CSRRW GPR:$rd, SysRegFCSR.Encoding, GPR:$rs), 0>;
-def : InstAlias<"fssr $rs",       (CSRRW      X0, SysRegFCSR.Encoding, GPR:$rs), 0>;
+// frsr, fssr are obsolete aliases replaced by frcsr, fscsr.
+def : MnemonicAlias<"frsr", "frcsr">;
+def : MnemonicAlias<"fssr", "fscsr">;
 
 def : InstAlias<"frrm $rd",        (CSRRS  GPR:$rd, SysRegFRM.Encoding, X0), 2>;
 def : InstAlias<"fsrm $rd, $rs",   (CSRRW  GPR:$rd, SysRegFRM.Encoding, GPR:$rs)>;

``````````

</details>


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


More information about the llvm-commits mailing list