[PATCH] D89025: [RISCV] Add -mtune support
Kito Cheng via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 7 20:45:39 PDT 2020
kito-cheng created this revision.
kito-cheng added reviewers: asb, evandro, lenary, khchen.
kito-cheng added projects: LLVM, clang.
Herald added subscribers: llvm-commits, cfe-commits, dang, luismarques, apazos, sameer.abuasal, pzheng, pengfei, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
kito-cheng requested review of this revision.
Herald added a subscriber: MaskRay.
- The goal of this patch is improve option compatible with RISCV-V GCC, -mcpu support on GCC side will sent patch in next few days.
- -mtune only affect the pipeline model and non-arch/extension related target feature, e.g. instruction fusion; in td file it called TuneFeatures, which is introduced by X86 back-end[1].
- -mtune accept all valid option for -mcpu and extra alias processor option, e.g. `generic`, `rocket` and `sifive-7-series`, the purpose is option compatible with RISCV-V GCC.
- Processor alias for -mtune will resolve according the current target arch, rv32 or rv64, e.g. `rocket` will resolve to `rocket-rv32` or `rocket-rv64`.
- Interaction between -mcpu and -mtune:
- -mtune has higher priority than -mcpu for pipeline model and TuneFeatures.
[1] https://reviews.llvm.org/D85165
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89025
Files:
clang/include/clang/Driver/Options.td
clang/lib/Basic/Targets/RISCV.cpp
clang/lib/Basic/Targets/RISCV.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/riscv-cpus.c
clang/test/Misc/target-invalid-cpu-note.c
llvm/include/llvm/Support/RISCVTargetParser.def
llvm/include/llvm/Support/TargetParser.h
llvm/lib/Support/TargetParser.cpp
llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
llvm/lib/Target/RISCV/RISCVSubtarget.cpp
llvm/lib/Target/RISCV/RISCVSubtarget.h
llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89025.296860.patch
Type: text/x-patch
Size: 16420 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201008/a5547271/attachment-0001.bin>
More information about the cfe-commits
mailing list