CT_00_048 -- xz vectorization using "early break" vectorization
About
Early break vectorization is a method for vectorizing loops which scan memory, breaking from the scan loop when a particular condition is met. Traditionally these vectorization opportunities have been recognized with loop idiom recognizers such as rawmemchr. Early break vectorization allows these loops to be vectorized in a more generic way without writing a custom loop recognizer. It is expected this can be used to vectorize the key search loop in the xz benchmark from spec2017.
Ventana has written an internal recognizer for the key loop in xz, roughly mirroring the current LLVM approach. For the xz ref inputs in spec2017 it results in a 1%, 20%+ and 10% improvement respectively. That code was meant to evaluate the gains and provide a target for the generic approach that is ongoing in the vectorizer. If you would like a copy of that code, reach out to Jeff or Robin at Ventana
This item is largely meant to track the overall effort, which may well defer into 2025. While Ventana has a custom solution in place, that's really just meant for evaluation, not integration.
Stakeholders/Partners
RISE:
Ventana: Robin Dapp
Ventana: Jeff Law
SiFive: Craig Topper
External:
Linaro: Alex Coplan, Tamar Christiana
Dependencies
Status
Development | IN PROGRESS |
|
|---|---|---|
Development Timeline | 2H2025 |
|
Upstreaming | NOT YET STARTED |
|
Upstream Version | gcc-16 Spring 2026
|
|
Contacts | Jeff Law (Ventana) |
|
Dependencies |
|
|
Updates
Jul 16, 2025
Ventana's POC/custom loop recognizer improves performance of 557.xz as a whole by >10%, but it isn't really suitable for upstreaming
Linaro's early break vectorization landed in gcc-15. That's the real solution to this class of vector opportunities
Doesn't perform well on RISC-V yet. Keeping this item open to track fixing those issues and enabling.
Feb 3, 2025
Next phase of project noted for 2025