[llvm] 4014e2e - [TableGen][RISCV] Strip experimental- prefix in profile names in SupportedExperimentalProfiles

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 23:31:08 PDT 2024


Author: Alex Bradbury
Date: 2024-05-14T07:30:28+01:00
New Revision: 4014e2e045f5160ce9cbb9562d151f540d61c0bb

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

LOG: [TableGen][RISCV] Strip experimental- prefix in profile names in SupportedExperimentalProfiles

This matches what we do for extensions, and saves us having to do it in
RISCVISAInfo.

This is a minor tweak to what I added in #91993.

Added: 
    

Modified: 
    llvm/test/TableGen/riscv-target-def.td
    llvm/utils/TableGen/RISCVTargetDefEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/TableGen/riscv-target-def.td b/llvm/test/TableGen/riscv-target-def.td
index e328a6e3b5834..fb58448d7ce88 100644
--- a/llvm/test/TableGen/riscv-target-def.td
+++ b/llvm/test/TableGen/riscv-target-def.td
@@ -147,7 +147,7 @@ def ROCKET : RISCVTuneProcessorModel<"rocket",
 // CHECK-NEXT: };
 
 // CHECK:      static constexpr RISCVProfile SupportedExperimentalProfiles[] = {
-// CHECK-NEXT:     {"experimental-rvi99u64","rv64i2p1"},
+// CHECK-NEXT:     {"rvi99u64","rv64i2p1"},
 // CHECK-NEXT: };
 
 // CHECK:      #endif // GET_SUPPORTED_PROFILES

diff  --git a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp b/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
index d174b1961344f..b76ba05954aa5 100644
--- a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
@@ -134,7 +134,9 @@ static void printProfileTable(raw_ostream &OS,
     if (Rec->getValueAsBit("Experimental") != Experimental)
       continue;
 
-    OS.indent(4) << "{\"" << Rec->getValueAsString("Name") << "\",\"";
+    StringRef Name = Rec->getValueAsString("Name");
+    Name.consume_front("experimental-");
+    OS.indent(4) << "{\"" << Name << "\",\"";
     printMArch(OS, Rec->getValueAsListOfDefs("Implies"));
     OS << "\"},\n";
   }


        


More information about the llvm-commits mailing list