[LLVMbugs] [Bug 2698] InstCombine caused 20% slowdown in bzip2

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Dec 22 16:05:45 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=2698


Chris Lattner <clattner at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #15 from Chris Lattner <clattner at apple.com>  2009-12-22 18:05:44 ---
Ok, the whole premise of this xform is invalid.  You want to transform this:

  %A = xor i8 %x, -128                            ; <i8> [#uses=2]
  %B = xor i8 %y, -128                            ; <i8> [#uses=2]
  %C = icmp ult i8 %A, %B                         ; <i1> [#uses=2]

into:

  %C = icmp slt i8 %x, %y                         ; <i1> [#uses=2]

even when A/B have multiple uses.  This increases register pressure, which is
exactly what the code you're disabling is trying to prevent.  This is also why
the code causes random reg pressure swings.  The single-use case:

  declare void @foo(i1, i1, i8, i8)

  define void @x(i8 %x, i8 %y, i8 %z) {
    %A = add i8 %x, -128
    %B = add i8 %y, -128
    %C = icmp ult i8 %A, %B
    call void @foo(i1 %C, i1 %C, i8 0, i8 0)
    ret void
  }

is correctly transformed even without this patch.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list