[RISCV] Support -mcpu/mtune=native
authorwangpc <pc.wang@linux.alibaba.com>
Mon, 7 Nov 2022 02:40:19 +0000 (10:40 +0800)
committerwangpc <pc.wang@linux.alibaba.com>
Mon, 7 Nov 2022 02:43:32 +0000 (10:43 +0800)
commit7c50bcb441707f862cd7fcd07d81fbcdc29e98dc
treeb67007cb91fdb108615105981eff72352949f550
parent34f687cbe468e8044e8d94c977a2e47cbd3f3799
[RISCV] Support -mcpu/mtune=native

We may need hosted Clang/LLVM to compile and `getHostCpuName`
can be used for native detection.

Tests are added in riscv-cpus.c just like what AArch64/PPC
have done.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D136930
clang/docs/ReleaseNotes.rst
clang/lib/Driver/ToolChains/Arch/RISCV.cpp
clang/lib/Driver/ToolChains/Arch/RISCV.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/riscv-cpus.c