[llvm] [SystemZ] Use scheduling model for load latency (PR #217617)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 06:07:29 PDT 2026
MarkVeerasingam wrote:
@JonPsson1 Thanks for the detailed review! I may have approached this from the wrong direction.
I wasn't trying to model the AArch64 implementation or address a specific benchmark. I was looking for existing SystemZ FIXMEs / areas where I could make a first SystemZ contribution, and this looked reasonable.
Currently, the `TTI` path falls back to the generic LLVM cost, while the SystemZ scheduling model already provides load latency information. In my testing, the relevant SystemZ load opcodes currently report a latency of 4 on z13 through to z17.
If `TCK_Latency` isn't currently defined for SystemZ, would you be open to working through what the appropriate SystemZ cost model should be, using the scheduler's existing latency information as a starting point?
Your comment about `L`, `L`, `L + 1` for `2xi32`, `4xi32`, and `8xi32` seems like a useful starting point. I'm mainly trying to understand how that incremental cost should be derived, in particular whether it belongs in `TTI` as a model of the additional pipelined loads, or whether there is an existing scheduler mechanism we should be using.
I did a quick check of the existing SystemZ scheduling model. For z13 through to z17, the representative integer/vector load instructions (`LLC`, `LLH`, `L`, `LG`, `L128`, and `VL`) all currently report a scheduler latency of 4.
I am thinking for the `L`, `L`, `L + 1` cost for `2xi32`, `4xi32`, and `8xi32`, isn't coming directly from `computeInstrLatency(VL)`. `VL` itself reports `4` for all three.
Would the intended TTI model therefore be to use the scheduler's latency for the base cost and then add separate `TTI` logic to account for the additional register/load needed for the wider vector? I'm hesitant to introduce logic such as +1 here without understanding the cost-model assumption.
If so, I'd like to understand how you'd prefer that incremental cost to be modeled in SystemZ TTI.
https://github.com/llvm/llvm-project/pull/217617
More information about the llvm-commits
mailing list