Skip to content

cmd/compile: avoid reloads of temp register on ppc64le, others #17110

@laboger

Description

@laboger

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +9fcbde7 Wed Sep 14 10:07:17 2016 -0500 linux/ppc64le

What operating system and processor architecture are you using (go env)?

Ubuntu 16.04 ppc64le

What did you do?

Built the test from the math package, then inspected the objdump.

What did you expect to see?

Looking for opportunities for improvement.

What did you see instead?

In main.main, this code is generated:
111c8: 1f 00 e0 3f lis r31,31
111cc: 98 29 9f e8 ld r4,10648(r31)
111d0: 1f 00 e0 3f lis r31,31
111d4: 90 29 bf e8 ld r5,10640(r31)
111d8: 1f 00 e0 3f lis r31,31
111dc: e0 29 df e8 ld r6,10720(r31)
111e0: 1f 00 e0 3f lis r31,31
111e4: d8 29 ff e8 ld r7,10712(r31)
111e8: 1f 00 e0 3f lis r31,31
111ec: d0 29 1f e9 ld r8,10704(r31)
111f0: 1f 00 e0 3f lis r31,31
111f4: a0 29 3f e9 ld r9,10656(r31)
111f8: 1f 00 e0 3f lis r31,31
111fc: b0 29 5f e9 ld r10,10672(r31)
11200: 1f 00 e0 3f lis r31,31
11204: b8 29 7f e9 ld r11,10680(r31)
11208: 1f 00 e0 3f lis r31,31
1120c: c0 29 9f e9 ld r12,10688(r31)

r31 is reloaded each time with the same value. I believe this happens because this is a MOVD based on SB which implicitly generates two instructions, and uses r31 for the temp register and possibly that is not visible to the register allocator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions