Issue 237923
Summary [AArch64] Redundant pointer reloads and checks across parser-loop dispatch
Labels new issue
Assignees
Reporter bagrorg
    After consuming a comma, Clang returns through generic loop checks and reloads the buffer/cursor pointers in the selected switch case. GCC retains these pointers and dispatches directly.

[Reproducer on Compiler Explorer](https://godbolt.org/z/3GMcMfjra): includes C++ source and saved **original** and **patched** Clang assembly. The patched assembly demonstrates the expected pointer reuse and control flow, following GCC’s codegen.

Tested configuration:

- **Clang:** 24.0.0git, LLVM `cd3be30dcbabdf92067782b62dd5f3d995fd5d23`
- **GCC:** 16.0.1 20260322, `r16-8246-g569ace1fa50`
- **Hardware/OS:** Neoverse V3, Linux AArch64
- **Flags:** `-O3 -DNDEBUG -std=c++17 -mcpu=neoverse-v3`

Measurements:

| Original Clang | Patched Clang | GCC |
|---:|---:|---:|
| 32.9756 ns/row | 17.1338 ns/row | 18.4703 ns/row |

Originally observed in [simdjson’s Amazon column loop](https://github.com/simdjson/simdjson/blob/3b2870d822b1797cfebb368cd76df0413a7016bb/benchmark/amazon_cellphones/simdjson_ondemand.h#L30-L46), revision `3b2870d822b1797cfebb368cd76df0413a7016bb`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to