[go] cmd/internal/obj/riscv: compress function returns

2 views
Skip to first unread message

Joel Sing (Gerrit)

unread,
Aug 9, 2026, 1:03:34 AM (yesterday) Aug 9
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, David Chase, Mark Freeman, Meng Zhuo, golang...@luci-project-accounts.iam.gserviceaccount.com, Mark Ryan, Julian Zhu, golang-co...@googlegroups.com

Joel Sing submitted the change

Change information

Commit message:
cmd/internal/obj/riscv: compress function returns

Compress the JALR used for bare function returns using CJR. This can be
done since relocations are never associated with a bare return - note
that returns with a non-LR register and return jumps are left unchanged.

This results in around another 2,700 instructions being compressed
in the Go binary on linux/riscv64.

Updates #71105
Change-Id: If3a94e272cdf4cd222bc9ffd9d6dc840a10a0406
Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64
Reviewed-by: Mark Freeman <markf...@google.com>
Reviewed-by: David Chase <drc...@google.com>
Reviewed-by: Meng Zhuo <mengzh...@gmail.com>
Files:
  • M src/cmd/internal/obj/riscv/obj.go
Change size: XS
Delta: 1 file changed, 5 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: If3a94e272cdf4cd222bc9ffd9d6dc840a10a0406
Gerrit-Change-Number: 807460
Gerrit-PatchSet: 6
Gerrit-Owner: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Mark Ryan <mark...@meta.com>
Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages