Skip to content
  1. Jan 20, 2010
  2. Jan 19, 2010
  3. Jan 18, 2010
    • Evan Cheng's avatar
      Canonicalize -1 - x to ~x. · 88b65bc8
      Evan Cheng authored
      Instcombine does this but apparently there are situations where this pattern will escape the optimizer and / or created by isel. Here is a case that's seen in JavaScriptCore:
        %t1 = sub i32 0, %a
        %t2 = add i32 %t1, -1
      The dag combiner pattern: ((c1-A)+c2) -> (c1+c2)-A
      will fold it to -1 - %a.
      
      llvm-svn: 93773
      88b65bc8
Loading