You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem occurs when the machine outliner extracts a chunck of code which
contains a call and loads or stores a pair of registers from or into the
stack, such as:
LR needs to be saved into the stack when jumping in such an outlined
function and stack's offsets should be changed accordingly, thus the
function should look like:
But in the code generated by llvm-12 for Thumb2 targets, the stack offsets
are not patched. In fact, these offsets are patched in the MIR by the
Machine Outliner, but it assumes that immediates encoded in
AddrModeT2_i8s4 instructions are scaled like it is the case for the other
addressing modes.
I'll submit a small patch to fix the outliner which will change the scale
and bit number in that part, but maybe it'd be nice to do a bigger change
to make the encoding more consistent (there are already some fixme notes
about that in the code)
The text was updated successfully, but these errors were encountered:
Extended Description
This issue was reported and described by rust-lang community here:
rust-lang/rust#85351
The problem occurs when the machine outliner extracts a chunck of code which
contains a call and loads or stores a pair of registers from or into the
stack, such as:
bl foo
strd r0, r1, [sp, #0]
strd r2, r3, [sp, #8]
LR needs to be saved into the stack when jumping in such an outlined
function and stack's offsets should be changed accordingly, thus the
function should look like:
<OUTLINED_FUNCTION_0>:
str.w lr, [sp, #-8]!
bl foo
strd r0, r1, [sp, #8]
strd r2, r3, [sp, #16]
ldr.w lr, [sp], #8
bx lr
But in the code generated by llvm-12 for Thumb2 targets, the stack offsets
are not patched. In fact, these offsets are patched in the MIR by the
Machine Outliner, but it assumes that immediates encoded in
AddrModeT2_i8s4 instructions are scaled like it is the case for the other
addressing modes.
I'll submit a small patch to fix the outliner which will change the scale
and bit number in that part, but maybe it'd be nice to do a bigger change
to make the encoding more consistent (there are already some fixme notes
about that in the code)
The text was updated successfully, but these errors were encountered: