[PATCH] D71124: [RISCV] support clang driver to select cpu

Kuan Hsu Chen (Zakk) via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 10 01:48:16 PDT 2020


khchen updated this revision to Diff 276951.
khchen added a comment.

addess asb's comment.

[RISCV][Clang] Support -mcpu option.

Summary:

1. gcc uses `-march` and `-mtune` flag to chose arch and

pipeline model, but clang does not have `-mtune` flag,
we uses `-mcpu` to chose both info.

2. Add SiFive e31 and u54 cpu which have default march

and pipeline model.

3. Specific `-mcpu` with rocket-rv[32|64] would select

pipeline model only, and use the driver's arch choosing
logic to get default arch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71124/new/

https://reviews.llvm.org/D71124

Files:
  clang/lib/Basic/Targets/RISCV.cpp
  clang/lib/Basic/Targets/RISCV.h
  clang/lib/Driver/ToolChains/Arch/RISCV.cpp
  clang/lib/Driver/ToolChains/Arch/RISCV.h
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/riscv-cpus.c
  llvm/include/llvm/Support/RISCVTargetParser.def
  llvm/include/llvm/Support/TargetParser.h
  llvm/lib/Support/TargetParser.cpp
  llvm/lib/Target/RISCV/RISCV.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71124.276951.patch
Type: text/x-patch
Size: 17919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200710/eef4ae88/attachment-0001.bin>


More information about the cfe-commits mailing list