[llvm] [AArch64] Improve fixed vector lowering for cttz/ctlz when sve (PR #192427)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 06:10:51 PDT 2026


paulwalker-arm wrote:

Thanks for splitting the patch.  Looking at the output changes I don't understand the reason for favouring SVE when related NEON instructions exist.

>From what I can see, within the main `fixedlen_vector_valuetypes` loop we have `setOperationAction(ISD::CTTZ, VT, Expand)`.  If you switch that to `Custom` and then update `AArch64TargetLowering::LowerCTTZ` accordingly, we'll get much of the benefit without needing SVE. My understanding is we only need to use SVE for the vNi64 cases.

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


More information about the llvm-commits mailing list