update implementation and handle -mcpu with explicitly specified -march.
If -mcpu has default march, explicitly -march will overwrite it.
- reference ARM/AArch64 and X86 to implement RISCVTargetParser.def
- in clang, -mtune option alias to -mcpu. This patch supports -mtune option via -mcpu.
- propose two category of CPUs in TargetParser and backend. First is similar gcc's -mtune option (it includes micro architecture related feature only, ex. rocket-rv32 has different schedule model), another also has default -march (isa string).
- add two sifive cpu which has default -march
- changed default march logic.
march: in order:
- Explicit choices using -march
- A default based on -mcpu, if target cpu has default -march
- default based on -mabi, if provided
- A default based on the target triple's arch
I think it's also okay if we want to only support -mcpu which is similar to gcc's -mtune at the moment . Because in current implementation,
users can query available CPUs via -mcpu=? on clang but mcpu option is not workable.
I think this should test cpu name is valid first. And assign Name to CPU, if it is valid.