Skip to content

Commit c3ebc38

Browse files
toppercgithub-actions[bot]
authored andcommitted
Automerge: [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.
2 parents a8c3bb1 + 429e315 commit c3ebc38

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)