llvm / llvm/llvm-project

[AArch64] Missed store pairing opportunity in SPEC17 perlbench due to union TBAA

Open
#220,536 1 comment 0 reactions 0 assignees View on GitHub
backend:AArch64 missed-optimization
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Reduced test case: https://godbolt.org/z/483r6TzEe extracted from SPEC2017 Perlbench.

The stores:
```
rex->lastparen = n;
rex->lastcloseparen = st->u.branch.lastcloseparen;
```
reside adjacent in memory and can be written out with an `stp` but st->u (which is a union access) prevents it from happening.

Similar issue https://github.com/llvm/llvm-project/issues/147449

Contributor guide

Open the contributing guide

Research direction

Start with the reduced test case at https://godbolt.org/z/483r6TzEe and inspect the generated AArch64 code for the two adjacent stores. Investigate how the union access through st->u and TBAA affect store pairing, using issue #147449 for related context. Done means the stores can be emitted as an stp where the alias information permits it, with coverage for the reduced case.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.