[llvm] [InstCombine] Canonicalize more saturated-add variants (PR #100008)
    Rose Silicon via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Jul 30 11:28:49 PDT 2024
    
    
  
RSilicon wrote:
> > @topperc Do you have any objections to this PR as it is of now?
> 
> Remove the nuw handling unless you can show a real world test that benefits from it. We don't have to solve every possible case in InstCombine.
X > -C ? -1 : X + C is the canonicalization of the literal definition of sat.add.
X + C has to be nuw for this to work. 
X >= -C + 1 is basically a weird version of this. 
https://github.com/llvm/llvm-project/pull/100008
    
    
More information about the llvm-commits
mailing list