[PATCH] D98307: [RISCV] Remap 'generic' CPU to 'generic-rv32' or 'generic-rv64'. Validate 64Bit feature against the triple.

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 10:26:52 PST 2021


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVSubtarget.cpp:62
+  else
+    TuneCPU = RISCV::resolveTuneCPUAlias(TuneCPU, Is64Bit);
+
----------------
Huh, TIL this has been added. Is there a reason not to use this for CPU? I guess because we want a version that returns llvm::Optional?


================
Comment at: llvm/lib/Target/RISCV/RISCVSubtarget.cpp:58-59
     CPUName = Is64Bit ? "generic-rv64" : "generic-rv32";
   if (TuneCPUName.empty())
     TuneCPUName = CPUName;
   ParseSubtargetFeatures(CPUName, TuneCPUName, FS);
----------------
craig.topper wrote:
> jrtc27 wrote:
> > jrtc27 wrote:
> > > Should we be mapping -mtune=generic to generic-rv$XLEN too?
> > (For consistency, and although it seems like a stupid thing to do, maybe you want to override a non-generic default back to generic)
> i'm not sure what you mean with "maybe you want to override a non-generic default back to generic"
Oh as in either your system toolchain decides to bake in a different default or you're building something that already does -mtune=rocket-rv$XLEN and you want to override it back to -mtune=generic by adding that to CFLAGS.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98307/new/

https://reviews.llvm.org/D98307



More information about the llvm-commits mailing list