[llvm] [clang] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

Wang Pengcheng via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 00:18:31 PST 2024


wangpc-pp wrote:

> > As for your diffs, it seems that you only handle the `__riscv_save/restore_[2|1|0]`, which is incomplete. And the code is not different with non-rve cases?
> 
> Yes, I mostly copy-pasted the existing code and removed all of the code dealing with registers not available on RV32E, so having only `__riscv_save/restore_[2|1|0]` is intended I suppose because there are only this many saved registers on RV32E. (There's probably a better way of doing it, and it looks like I screwed up the RV64E part of the patch.)
> 
> If I remember correctly I think I did this because otherwise compiling `compiler-rt` was not possible for RV32E and the compilation was spewing out errors about the unavailable registers? But I need to check this again once I finish porting this newest version of the patch to the most recent version of Rust.

Oh, I see. My previous comment was wrong.
I just checked GCC implementation, we do need to handle RVE cases (but GCC still lacks of RV64E handling). LLVM hasn't handled this mainly because we haven't support RVE now, I think.
Can you fire a PR for these changes? I think we should support it in compiler-rt once we have merge this PR.

https://github.com/llvm/llvm-project/pull/76777


More information about the cfe-commits mailing list