- User Since
- Oct 23 2013, 8:22 AM (326 w, 2 d)
Thu, Jan 16
I fixed bug here, but I'm not sure this small fixed should be another commit or not.
@lenary, do you have any suggestion?
Wed, Jan 15
Tue, Jan 14
This patch is necessary for enabling LTO
backend does this mismatch checking before getSubtargetImpl which reads the target-feature info from IR function attribute, and it will reset the target-abi if mismatching happen.
because I don't want to break this mismatch checking feature, so I move this checking later than getSubtargetImpl execution.
Mon, Jan 13
I think putting the resetTargetDefaultOptions after instance of TargetMachine is too late.
ppc and mips compute the TargetABI in XXXXTargetMachine constructor. In addition , mips compute the DataLayout with target ABI in TargetMachine constructor.
Sun, Jan 12
Could you please guide me and review this PoC?
or take a look at this [[ take a look at | maillist ]] thread?
Thu, Jan 9
remote LTO related code.
this PoC include D70837 patch for generate correct code.
Mon, Jan 6
I'd like to discuss what is good way to pass target-abi in maillist after I had a try to encoding ABI info into LLVM IR via module flag.
any suggestions are welcome, thanks.
Sun, Jan 5
Dec 19 2019
The problem is how -mcpu interact with explicitly specified -march (or target features).
Dec 17 2019
I asked @kito-cheng about the GCC LTO behavior,
GCC LTO encodes the ABI info in elf and the behavior in above examples match to @efriedma 's responses.
So I think maybe encode ABI in module metadata flag is a good ideal.
Dec 11 2019
update missed code..
Dec 10 2019
Dec 6 2019
BTW, I used this patch and D71124 to run the CoreMark on HiFive unleashed with -O3 -mllvm -enable-misched -mllvm -enable-post-misched -mcpu=rocket-rv64,
the result is better than -O3 -mllvm -enable-misched -mllvm -enable-post-misched and get the performance 3.5% speedup (use ld.bfd and libgcc).
Dec 3 2019
Nov 29 2019
Nov 28 2019
add expected failed case, it will be fixed in a subsequent patch.
Nov 27 2019
Yes. Okay, agree with you.
Presumably the next steps are to work out how to pass -target-abi through to the LTO backend via attributes? I was trying to see how other backends did this, but I'm not sure. I think the right way may be to have a feature per ABI, like ARM does here: https://github.com/llvm/llvm-project/blob/2d739f98d8a53e38bf9faa88cdb6b0c2a363fb77/clang/lib/Driver/ToolChains/Arch/ARM.cpp#L313-L319
It might be worth sending an email to llvm-dev, asking for guidance.
Nov 26 2019
Nov 21 2019
Re-applied with test fix in https://reviews.llvm.org/rG4fccd383d571865321b4723b81c3042d2c15fd80
@lenary failed again,
I will setup windows platform to figure out what's going on.
Nov 19 2019
Nov 18 2019
rebase and fix failed testcases
Nov 15 2019
Nov 14 2019
I found RISCVABI::computeTargetABI will check ABI with target feature,
so when I apply this patch and enabling lto, the checking get failed and set ABI to ABI_Unknown.
This is a problem because target-features is per-function basis but ABI is not.
Nov 12 2019
I think in RISC-V using -mabi is a convention way for specific calling convention in gcc and clang, and more clear than -msoft-float.
but unfortunately compiling source code with -mabi=ilp32 will not generate correct value like "use-soft-float"="true" in bitcode,
so we can fix clang (?) and let backend inspect the "soft-float" attribute, or fix clang driver to pass -mabi to LTO code generator in RISC-V target.
Nov 8 2019
Nov 3 2019
Nov 2 2019
LGTM, thanks for the patch!
Oct 24 2019
You patch is very useful to look up the default march, thanks!
But there is some issue if we set the default rv32 march as rv32gc.
Because the default multilib does not include rv32gc/lp32d in riscv gnu toolchain, https://github.com/riscv/riscv-gcc/blob/ed3f6ec/gcc/config/riscv/t-elf-multilib#L19
so if user does not give the default march clang will not find the library and cause linking error.
Do you think this is a clang's problem? or maybe this is just user's problem so they should config multilib to support rv32gc/lip3d2d?
Oct 23 2019
Oct 15 2019
@lenary Sorry, I don't have the plan to support MULTILIB_REUSE now.
But if it's necessary to support it, I can do it later.
Oct 14 2019
https://reviews.llvm.org/D66003 changed the riscv::getRISCVTargetFeatures interface.
Sep 24 2019
@tejohnson for example:
$ clang -flto a.c -c -o a.o $ llvm-ar q a.a a.o // archive libraries $ clang -flto a.a b.c -O2 -o main -mcmodel=small
Sep 23 2019
@tejohnson when I run the clang -flto -Wl,-plugin-opt=-help command, it shows the
--code-model=<value> - Choose code model =tiny - Tiny code model =small - Small code model =kernel - Kernel code model =medium - Medium code model =large - Large code model
so I think the clang driver need to pass this info to LTO codegen, does it make sense?
Sep 22 2019
Sep 18 2019
Thanks @lenary, I fixed it.
Sep 15 2019
Sep 14 2019
added a test
This commit is inspired by @MaskRay's suggestion, I think maybe fix the insufficient of clang::driver:tools::AddGoldPlugin is good choose.
Sep 12 2019
@lenary Yes, you are right. add LTO support for Linux platform.