[llvm] [DAG] fold avgu(zext(x), zext(y)) -> zext(avgu(x, y)) (PR #95134)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 05:10:32 PDT 2024


RKSimon wrote:

> > > Any plans to do avgs(sext(x), sext(y)) -> sext(avgs(x, y)) ?
> > 
> > 
> > IIRC the constraints on that pattern aren't as easy as the unsigned cases.
> 
> Really? My instinct is that it should Just Work, but I have not thought about it deeply.

I'm miss-remembering - it looks like it just needs an explicit freeze in the alive test where the unsigned cases didn't https://alive2.llvm.org/ce/z/qgp7bF

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


More information about the llvm-commits mailing list