[PATCH] D70116: [RISCV] add subtargets initialized with target feature

Kuan Hsu Chen (Zakk) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 18:07:42 PST 2019


khchen requested review of this revision.
khchen added a comment.

In D70116#1745601 <https://reviews.llvm.org/D70116#1745601>, @khchen wrote:

> I found RISCVABI::computeTargetABI will check <https://github.com/llvm-mirror/llvm/blob/master/lib/Target/RISCV/Utils/RISCVBaseInfo.cpp#L40-L50> ABI with target feature, 
>  so when I apply this patch and enabling lto, the checking get failed and set ABI to ABI_Unknown.
>  It's not easy to fix it because target-features is per-function basis but ABI is not.


It looks like assembler need to read the assembly directive like `.attribute arch, rv32i2p0_m2p0_a2p0_f2p0_d2p0_c2p0` to initial the target feature before abi checking (`computeTargetABI`).
so I will fix this part (generate and parse assembly directive) later.

> In addition, I think my testcase is so weird and it does not make sense there are different isa extension are used in the same compilation unit...
>  maybe before checking the invalid ABI, backend need to gather all isa-extension target-feature attribute from functions and decide which standard extension should used if user does not specific `-march`. 
>  or assume in RISC-V "isa extension target feature" should be specific in codegen and the clang driver treat them as specific case so driver will only pass "isa extension target feature" into LTO code generator.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70116





More information about the llvm-commits mailing list