Skip to content

Commit 429e315

Browse files
authored
[RISCV] Convert -mtune=generic to generic-rv32/rv64 in RISCVSubtarget::initializeSubtargetDependencies. (#168612)
The "generic" entry in tablegen is really a dummy entry. We shouldn't use it for anything. Remap "generic" to either generic-rv32 or generic-rv64 based on the triple.
1 parent 58d9e47 commit 429e315

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/RISCV/RISCVSubtarget.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ RISCVSubtarget::initializeSubtargetDependencies(const Triple &TT, StringRef CPU,
8888

8989
if (TuneCPU.empty())
9090
TuneCPU = CPU;
91+
if (TuneCPU == "generic")
92+
TuneCPU = Is64Bit ? "generic-rv64" : "generic-rv32";
9193

9294
TuneInfo = RISCVTuneInfoTable::getRISCVTuneInfo(TuneCPU);
9395
// If there is no TuneInfo for this CPU, we fail back to generic.

0 commit comments

Comments
 (0)