[llvm] [AArch64] Match BSP through trunc(and) canonicalization in OR combine (PR #198277)

Mariusz Masztalerczuk via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 00:09:34 PDT 2026


mmasztalerczuk wrote:

Done. The matcher is now inside tryLowerToBSL, and performORBSLTruncCombine is removed. I also moved the isTypeLegal(VT) check to the top of tryLowerToBSL so it covers both call sites.

One thing: Calling tryLowerToBSL only from LowerVectorOR is too early — DAGCombiner produces the (or (trunc (and A B)) ...) shape only afterwards. So performORCombine calls it again post-legalization (with an isVector() check, since it also runs for scalar ORs).

On VSELECT: happy to take a look, but it feels like a separate PR

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


More information about the llvm-commits mailing list