[llvm] 2ceaa13 - [RISCV][NFC] Use RISCVSubtarget method for predicate in RISCVFeatures.td when available

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 06:50:01 PDT 2023


Author: Alex Bradbury
Date: 2023-04-05T14:49:17+01:00
New Revision: 2ceaa13effe47377b8813167f6677e2aa5d07089

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

LOG: [RISCV][NFC] Use RISCVSubtarget method for predicate in RISCVFeatures.td when available

As RISCVSubtarget defines hasStdExtZfhOrZfhmin() and hasStdExtCOrZca(),
just use these for the matching Predicate definitions rather than
repeating the logic.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVFeatures.td b/llvm/lib/Target/RISCV/RISCVFeatures.td
index 3d3260d77d1b6..0d44f576c64bd 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -104,7 +104,7 @@ def HasStdExtZfh : Predicate<"Subtarget->hasStdExtZfh()">,
 def NoStdExtZfh : Predicate<"!Subtarget->hasStdExtZfh()">;
 
 def HasStdExtZfhOrZfhmin
-    : Predicate<"Subtarget->hasStdExtZfh() || Subtarget->hasStdExtZfhmin()">,
+    : Predicate<"Subtarget->hasStdExtZfhOrZfhmin()">,
                 AssemblerPredicate<(any_of FeatureStdExtZfh, FeatureStdExtZfhmin),
                                    "'Zfh' (Half-Precision Floating-Point) or "
                                    "'Zfhmin' (Half-Precision Floating-Point Minimal)">;
@@ -317,7 +317,7 @@ def FeatureStdExtZca
                        "floating point loads/stores)">;
 
 def HasStdExtCOrZca
-    : Predicate<"Subtarget->hasStdExtC() || Subtarget->hasStdExtZca()">,
+    : Predicate<"Subtarget->hasStdExtCOrZca()">,
                 AssemblerPredicate<(any_of FeatureStdExtC, FeatureStdExtZca),
                                    "'C' (Compressed Instructions) or "
                                    "'Zca' (part of the C extension, excluding "


        


More information about the llvm-commits mailing list