Missed CALL relaxation due to single pass of CALL relaxations
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with the supplied RISC-V assembly and linker script, then run the llvm-mc, ld.eld, and llvm-objdump commands to reproduce the missed relaxation. Trace the linker’s CALL-relaxation pass and its handling of earlier calls. Done means the call at address 0x0 is relaxed to a JAL when its final displacement is in range.
Written by the indexing model from the issue text.
Description
We only perform a single pass of CALL relaxations. This result in missed relaxations when a CALL relaxation can decrease the caller -callee displacement of a previous call.
Reproducer:
#!/usr/bin/env bash
cat >1.s <<\EOF
.section .text
.global _start
_start:
jump high, t0
.section .high, "ax", @progbits
jump high, t0
high:
nop
EOF
cat >script.t <<\EOF
SECTIONS {
.text 0x0 : { *(.text) }
.high 0xffffa : { *(.high) }
}
EOF
llvm-mc -o 1.o -filetype=obj -triple=riscv64 -mattr=+c,+relax 1.s
#clang -o 1.o 1.s -c
LDs=(ld.eld)
SFs=(eld)
for i in "${!SFs[@]}"; do
${LDs[$i]} -o 1.${SFs[$i]}.out 1.o -T script.t
done
llvm-objdump -d 1.eld.out output:
Disassembly of section .text:
0000000000000000 <_start>:
0: 00100297 auipc t0, 0x100
4: ffc28067 jr -0x4(t0) <high>
Disassembly of section .high:
00000000000ffffa <.high>:
ffffa: a009 j 0xffffc <high>
00000000000ffffc <high>:
ffffc: 0001 nop
The caller-callee displacement for the high call at 0x0 is 0xffffc that is within the range of immediate operand of JAL instruction
and thus we can relax AUIPC + JALR to JAL here.
- Dominant language
- C++
- Stars
- 259
- Forks
- 84
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 72
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qualcomm/eld
-
plugin-framework
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
documentation good first issue not-planned
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
bug good first issue plugin-framework
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·