User Details
- User Since
- Aug 19 2015, 6:56 AM (395 w, 5 d)
May 19 2022
Rebased!
Apr 25 2022
The documentation changes to the riscv-toolchain-conventions repository have been merged now, (https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/10). In addition, there's a pending patch to implement this in GCC (https://gcc.gnu.org/pipermail/gcc-patches/2022-March/592467.html). I think this means there's nothing blocking this except a rebase.
Mar 7 2022
Jan 31 2022
To summarize where I think this stands. We don't want to implement something in LLVM which is undocumented or not likely to be implemented for other tools, so I also opened a pull request to document this change (https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/10) in the hope that it could be later implemented for GCC. From the discussion on that pull request there's an understandable reluctance to introduce a feature which would stop libgcc/compiler-rt from being drop in replacements for each other.
Fix comment
Jan 17 2022
Added CFI directives to the __riscv_restore_tailcall_<N> functions
Nov 29 2021
Rebased
Nov 24 2021
Nov 22 2021
Nov 15 2021
Nov 4 2021
Nov 1 2021
Some of the previously changes made were undone in order to match the spec as-written (notably I undid the renaming of relocations).
I reverted some of the previous changes I made so that this patch matches the spec as currently written - this means it's two attributes again, and the diagnostic messages have been updated a bit too. The two Clang attributes match to the same LLVM attribute internally though.
I'm not entirely sure if there's anything that needs to be agreed on still for this. It feels like this has soft agreement, but I don't know whether I would get push back if I get this committed
Oct 18 2021
Sep 23 2021
Changes here:
I've tried to take into account most of the suggested changes into this update:
Sep 8 2021
Thanks for all of the prompt feedback, I'll incorporate the suggested changes and update the patch
Sep 7 2021
Jul 26 2021
Jun 28 2021
I've rebased and added an option so that the tailcall version of save/restore is only used if -mllvm -riscv-save-restore-tailcall is provided.
May 17 2021
It was pointed out in the RISC-V LLVM sync-up that these entry points could be in separate sections to allow -gc-sections to remove any unnecessary entry points. This would mitigate the code size penalty for small programs as only the required entry points would be pulled in, however it would require the linker script to behave and not reorder the sections, and would require some changes to ensure that the fallthrough function does not accidentally get collected.
On the RISC-V sync-up call I said I would try and provide some code size numbers for these changes. First I mentioned that I saw a code size regression when compiled Embench, here's per-benchmark numbers:
May 12 2021
Documentation for -msave-restore has been committed to riscv-toolchain-conventions, I have an additional pull request to document this proposed tail-call version here
May 4 2021
Apr 19 2021
Updated the implementation to closely match the __riscv_restore_N entry points.
I have updated this so that the generation of the address passed to the restore functions is done in a separate method RISCVFrameLowering::buildAddr. This handles both the code models and mirrors RISCVISelLowering::getAddr - it would be nice if these functions could share code, or at least be in a common place.
Mar 15 2021
Mar 1 2021
I've rebased, switched to a grouping of 2 for rv64 and 4 for rv32, and fixed the formatting/comments.
Nov 23 2020
Nov 18 2020
Jun 16 2020
Mar 26 2020
This looks good to me now.
Mar 19 2020
Looks tidy and a really decent set of tests. I've added a few comments, though they are mainly me agreeing with Simon's points.
Feb 25 2020
Looks good to me. Clang tests all pass on my local build.
Nov 22 2019
Nov 14 2019
Added tests that a user can specify a specific runtime library through --rtlib. Also rebased on master, and added a comment explaining the use of --rtlib=platform in the tests.
If I set -DCLANG_DEFAULT_RTLIB=compiler-rt I see the following failure in clang/test/Driver/cross-linux.c:
It seems that the option --rtlib=platform exists to force the driver to ignore the -DCLANG_DEFAULT_RTLIB for testing purposes, so I've added this option to the tests that were broken.
Okay. I'll see if I can find a way to test this when CLANG_DEFAULT_RTLIB is set, and then I'll resubmit
Nov 13 2019
Nov 7 2019
Okay I've reverted this in rG90ecfa2f5f7f . I'll make improvements and resubmit this for review.
I've changed this to always return ToolChain::UNW_None from RISCVToolChain::GetUnwindLibType now. As a consequence we get the original behaviour of only -lgcc being added to the link command.
This looks good to me, the only thing that I'm not sure about is the phrasing of the warnings:
Nov 6 2019
Nov 4 2019
I've rebased, and also refactored this to use AddRunTimeLibs and GetDefaultRuntimeLibType. The tests have been updated to reflect the changes. Notable changes compared to the last version of the patch:
Rebased, added a comment to explain that this is using the user provided triple instead of the canonical one, and split out the tests requiring a shell into separate files (clang/test/Driver/riscv{32,64}-toolchain-extra.c)
Oct 14 2019
Oct 4 2019
Rebased, updated tests from D68391 to check for existence of compiler-rt crtbegin/crtend and runtime library.
Rebased and added tests