Skip to content

[Microbenchmarks] Benchmark for vXi8 shift add/sub optimization#316

Open
grodranlorth wants to merge 1 commit intollvm:mainfrom
grodranlorth:shiftbm
Open

[Microbenchmarks] Benchmark for vXi8 shift add/sub optimization#316
grodranlorth wants to merge 1 commit intollvm:mainfrom
grodranlorth:shiftbm

Conversation

@grodranlorth
Copy link
Copy Markdown

A benchmark for evaluating the optimization in llvm/llvm-project#164200

RKSimon pushed a commit to llvm/llvm-project that referenced this pull request Mar 11, 2026
Fixes #164200

~~I will create a separate PR to the `llvm-test-suite` repo for the
microbenchmark for this change.~~ The benchmark is in
llvm/llvm-test-suite#316

In my experiments on an EC2 `c6i.4xl`, the change gives a small
improvement for the `x86-64`, `x86-64-v2`, and `x86-64-v3` targets. It
regresses performance on `x86-64-v4` (in particular, when the constant
decomposes into two shifts). The performance summary follows:

```
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v1.json results-opt-generic-v1.json  |tail -n1
OVERALL_GEOMEAN                         -0.2846         -0.2846             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v2.json results-opt-generic-v2.json  |tail -n1
OVERALL_GEOMEAN                         -0.0907         -0.0907             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v3.json results-opt-generic-v3.json  |tail -n1
OVERALL_GEOMEAN                         -0.1821         -0.1821             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v4.json results-opt-generic-v4.json  |tail -n1
OVERALL_GEOMEAN                         +0.0190         +0.0190             0             0             0             0
```
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 11, 2026
Fixes #164200

~~I will create a separate PR to the `llvm-test-suite` repo for the
microbenchmark for this change.~~ The benchmark is in
llvm/llvm-test-suite#316

In my experiments on an EC2 `c6i.4xl`, the change gives a small
improvement for the `x86-64`, `x86-64-v2`, and `x86-64-v3` targets. It
regresses performance on `x86-64-v4` (in particular, when the constant
decomposes into two shifts). The performance summary follows:

```
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v1.json results-opt-generic-v1.json  |tail -n1
OVERALL_GEOMEAN                         -0.2846         -0.2846             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v2.json results-opt-generic-v2.json  |tail -n1
OVERALL_GEOMEAN                         -0.0907         -0.0907             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v3.json results-opt-generic-v3.json  |tail -n1
OVERALL_GEOMEAN                         -0.1821         -0.1821             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v4.json results-opt-generic-v4.json  |tail -n1
OVERALL_GEOMEAN                         +0.0190         +0.0190             0             0             0             0
```
shermpay pushed a commit to shermpay/llvm-project that referenced this pull request Mar 12, 2026
Fixes llvm#164200

~~I will create a separate PR to the `llvm-test-suite` repo for the
microbenchmark for this change.~~ The benchmark is in
llvm/llvm-test-suite#316

In my experiments on an EC2 `c6i.4xl`, the change gives a small
improvement for the `x86-64`, `x86-64-v2`, and `x86-64-v3` targets. It
regresses performance on `x86-64-v4` (in particular, when the constant
decomposes into two shifts). The performance summary follows:

```
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v1.json results-opt-generic-v1.json  |tail -n1
OVERALL_GEOMEAN                         -0.2846         -0.2846             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v2.json results-opt-generic-v2.json  |tail -n1
OVERALL_GEOMEAN                         -0.0907         -0.0907             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v3.json results-opt-generic-v3.json  |tail -n1
OVERALL_GEOMEAN                         -0.1821         -0.1821             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v4.json results-opt-generic-v4.json  |tail -n1
OVERALL_GEOMEAN                         +0.0190         +0.0190             0             0             0             0
```
albertbolt1 pushed a commit to albertbolt1/llvm-project that referenced this pull request Mar 13, 2026
Fixes llvm#164200

~~I will create a separate PR to the `llvm-test-suite` repo for the
microbenchmark for this change.~~ The benchmark is in
llvm/llvm-test-suite#316

In my experiments on an EC2 `c6i.4xl`, the change gives a small
improvement for the `x86-64`, `x86-64-v2`, and `x86-64-v3` targets. It
regresses performance on `x86-64-v4` (in particular, when the constant
decomposes into two shifts). The performance summary follows:

```
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v1.json results-opt-generic-v1.json  |tail -n1
OVERALL_GEOMEAN                         -0.2846         -0.2846             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v2.json results-opt-generic-v2.json  |tail -n1
OVERALL_GEOMEAN                         -0.0907         -0.0907             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v3.json results-opt-generic-v3.json  |tail -n1
OVERALL_GEOMEAN                         -0.1821         -0.1821             0             0             0             0
$ ../MicroBenchmarks/libs/benchmark/tools/compare.py  benchmarks results-baseline-generic-v4.json results-opt-generic-v4.json  |tail -n1
OVERALL_GEOMEAN                         +0.0190         +0.0190             0             0             0             0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant