-
Notifications
You must be signed in to change notification settings - Fork 40
[RISCV] Implement Xqci Call Relaxations #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This PR has bugs. Working on them. |
|
Trying something now, where I undo unnecessary changes to try to work out what's causing the failures/bugs I'm seeing. |
0a0187f to
fad37a2
Compare
1dddeb9 to
d1a9688
Compare
|
I'm going to call out the following again from the message:
The structure of the whole function is now different. This is broadly because instead of choosing between 2 different possible relaxations (CALL to JAL or CALL to C_JAL), there are now three. This means a lot of the logic was going to end up with more and more nested ternaries and the like, and the logic was getting difficult to follow. Instead, the function is now written in the following way:
One nice advantage of how this ends up working is that |
test/RISCV/standalone/Relaxation/HI20_LO12_I_TO_GP/HI20_LO12_I_TO_GP.test
Show resolved
Hide resolved
|
From my PoV, this is ready to land, and I would like it to be backported to llvm 21. I think I have addressed the core of all of the comments so far. |
These relaxations are implemented as part of RISCVLDBackend::doRelaxationCall as they apply to the same relocation/instructions. The relaxations are: - `AUIPC; JALR ra` -> `QC.E.JAL` - `AUIPC; JALR zero` -> `QC.E.J` These respect the existing command-line switches which prevent these being applied when relaxations (or xqci relaxations) are disabled. These relaxations are described in http://github.com/quic/riscv-elf-psabi-quic-extensions/releases/latest This continues the implementation of qualcomm#147. I also took the time to refactor `doRelaxationCall` to make the priority between relaxations clearer, and the verbose "relaxation missed" messages be emitted later, once we're surer the relaxation has been missed. Signed-off-by: Sam Elliott <aelliott@qti.qualcomm.com>
5c72eb7 to
73a34cf
Compare
These relaxations are implemented as part of
RISCVLDBackend::doRelaxationCall as they apply to the same relocation/instructions.
The relaxations are:
AUIPC; JALR ra->QC.E.JALAUIPC; JALR zero->QC.E.JThese respect the existing command-line switches which prevent these being applied when relaxations (or xqci relaxations) are disabled. This is particularly important in this case as standard instructions are replaced by custom Xqci instructions, which will fail to execute on most RISC-V implementations.
These relaxations are described in
http://github.com/quic/riscv-elf-psabi-quic-extensions/releases/latest
This continues the implementation of #147.
I also took the time to refactor
doRelaxationCallto make the priority between relaxations clearer, and the verbose "relaxation missed" messages be emitted later, once we're surer the relaxation has been missed.