[llvm] [AArch64] Better bitcast costs. (PR #227354)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 08:49:14 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: David Green (davemgreen)

<details>
<summary>Changes</summary>

A bitcast between different register banks is essentially the same as a vector lane insert/extract, and should be costed the same as a cross-regbank copy. Between the same regbank it is free (outside of BE, which this does not try to handle, and bitcasts that need packing for which this is better than the existing fallback of 1 but isn't very accurate yet).

---
Full diff: https://github.com/llvm/llvm-project/pull/227354.diff


5 Files Affected:

- (modified) llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp (+22-10) 
- (modified) llvm/test/Analysis/CostModel/AArch64/cast.ll (+30-21) 
- (modified) llvm/test/Analysis/CostModel/AArch64/sve-cast.ll (+5) 
- (modified) llvm/test/Transforms/VectorCombine/AArch64/bitreverse-v8i8-to-gpr.ll (+2-2) 
- (modified) llvm/test/Transforms/VectorCombine/AArch64/sve-interleave-splat.ll (+4-3) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````

</details>


https://github.com/llvm/llvm-project/pull/227354


More information about the llvm-commits mailing list