-
Notifications
You must be signed in to change notification settings - Fork 45
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
move not using branch delay slot #290
Comments
Was this fixed by the big bunch of changes that stopped treating most CHERI instructions as having unmodeled side effects? |
So things have moved along, but right now we're still not using the branch delay slot. The assembly we're generating now is:
And it looks like either the cincoffset or the clc could be moved into the delay slot here. |
This is happening due to CFI_INSTRUCTION pseudo opcodes terminating the DelaySlotFiller search. However, it seems like those are emitted even if we have exceptions disabled... |
Using an up-to-date upstream Clang to compile this on plain mips64 doesn't do the delay slot filling either at -O2:
GCC however (with
This turns out to be ok for GDB; it has a list of instructions it allows to be in the prologue, and that includes instructions with delay slots. It scans forward until the end of the prologue (see the various
So, I guess the fix is to teach LLVM that it can fill the first delay slot in the function with a prologue instruction, provided there are no non-prologue instructions in between. Having said that, our MIPS baseline using LLVM suffers from the same missing optimisation, so we still have a fair comparison. |
That commit doesn't really prove the issue has been fixed in general, just that we don't trip over it any more for this specific case due to using a conditional move rather than a branch. If |
Since MIPS is also affected, I don't think we need to fix this here: https://cheri-compiler-explorer.cl.cam.ac.uk/z/6Dzy6U We should probably report it upstream instead. |
Closing issues that only affect MIPS. |
Function starts with:
But should produce:
The text was updated successfully, but these errors were encountered: