This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add rv32 or rv64 suffix to generic cpu name
Needs ReviewPublic

Authored by StephenFan on Aug 14 2022, 1:30 AM.

Details

Summary

Currently, host cpu name is determined by uarch line which is read from
/proc/cpuinfo. But since qemu's cpuinfo doesn't have an uarch line,
getHostCPUNameForRISCV would just return "generic".

This patch adds rv32 or rv64 suffix to "generic" string to avoid issues
like can't recognize "generic" cpu name.

Diff Detail

Event Timeline

StephenFan created this revision.Aug 14 2022, 1:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2022, 1:30 AM
StephenFan requested review of this revision.Aug 14 2022, 1:30 AM

We have generic in RISCV.td since D121149, is it not work for this case?

Determine if it is rv32 or rv64 by __riscv_xlen

We have generic in RISCV.td since D121149, is it not work for this case?

Oh, thanks for reminding me. Let me see.