[llvm] [AArch64][GlobalISel] Add pre-legalizer combines for AVGFLOOR and AVGCEIL (PR #192866)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 16:47:00 PDT 2026


Atafid wrote:

Rebase done, since the average operations aren't legal for scalars or oversized vectors on AArch64, I added a check for non-vectors and types over 128 bits to prevent crashes bc of legalization. Also I restricted the manual sext_inreg promotion to sub-legal types under 64 bits, which allows legal vectors to emit their native instructions like urhadd.2s. I ran the update script for tests and in the test diffs SDAG manages to emit native instructions for 256-bit cases while GlobalISel falls back to uaddl, I think it is expected since SDAG splits the vectors during type legalization, whereas we are pre-legalizer here. I hope it's ok ! About the other forms, do I add the checks for them now ? 

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


More information about the llvm-commits mailing list