[PATCH] D82778: [InstCombine] fma x, y, 0 -> fmul x, y

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 10:15:31 PDT 2020


dmgreen added a comment.

I think it's because of these ones:

  fma(+0, -x, 0) -> +0
  
  fmul(+0, -x) -> -0
  fadd(+0, -0) -> +0

Removing the fadd would leave it at -0. This is what alive2 comes up with:

  Processing fma.txt..                          
                                                
  ----------------------------------------      
    %ys = fma half %x, half %y, half 0.000000   
    ret half %ys                                
  =>                                            
    %ys = fmul half %x, %y                      
    ret half %ys                                
                                                
  ERROR: Value mismatch for half %ys            
                                                
  Example:                                      
  half %x = #xf461 (-17936)                     
  half %y = #x0000 (+0.0)                       
  Source value: #x0000 (+0.0)                   
  Target value: #x8000 (-0.0)                   


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82778/new/

https://reviews.llvm.org/D82778





More information about the llvm-commits mailing list