[llvm] [AggressiveInstCombine] Check profitability of low-bits mask table folds (PR #228736)

Dávid Bolvanský via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 3 11:15:07 PDT 2026


davidbolvansky wrote:

I dont want either, but a regression was observed.

The load cost is approximate here. AArch64 TTI gives a legal scalar load a throughput cost of 1, without accounting for load latency, address computation or cache behavior in this query.
Your original PR showed the x86 BMI2 benefit, but did not mention results for other targets. Could you summarize how you concluded that this fold is beneficial across targets? Our AArch64 zstd investigation suggests it is not always profitable.

I would prefer reverting the unconditional fold and reintroducing it with proper target-aware profitability checks, starting with the demonstrated BMI2 case.

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


More information about the llvm-commits mailing list