[clang] [llvm] Add clang driver changes to support MTI RISC-V (PR #134065)

Djordje Todorovic via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 7 03:56:44 PDT 2025


================
@@ -337,13 +337,17 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList &Args,
   // - On `riscv{XLEN}-unknown-elf` we default to `rv{XLEN}imac`
   // - On all other OSs we use `rv{XLEN}imafdc` (equivalent to `rv{XLEN}gc`)
   if (Triple.isRISCV32()) {
-    if (Triple.getOS() == llvm::Triple::UnknownOS)
+    if (Triple.getOS() == llvm::Triple::UnknownOS &&
+        Triple.getVendor() != llvm::Triple::MipsTechnologies)
       return "rv32imac";
     return "rv32imafdc";
   }
 
-  if (Triple.getOS() == llvm::Triple::UnknownOS)
+  if (Triple.getOS() == llvm::Triple::UnknownOS &&
+      Triple.getVendor() != llvm::Triple::MipsTechnologies)
     return "rv64imac";
+  if (Triple.getVendor() == llvm::Triple::MipsTechnologies)
+    return "rv64imafdc_zba_zbb_zicsr_zifencei";
----------------
djtodoro wrote:

Well, by just moving the `if (Triple.getVendor() == llvm::Triple::MipsTechnologies)` above, we make it cleaner.

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


More information about the cfe-commits mailing list