[llvm-bugs] [Bug 13958] LLVM doesn't optimize 64-bit inequalities best

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 12 03:43:54 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=13958

John Brawn <john.brawn.123 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |john.brawn.123 at gmail.com
         Resolution|---                         |FIXED

--- Comment #1 from John Brawn <john.brawn.123 at gmail.com> ---
This was fixed in r268557. With latest trunk if I compile

int fn(long long a, int *p)
{
  if (a < 0) {
    *p = 1;
    return 2;
  } else if (a > 0) { 
    *p = 2;
    return 3;
  } else { 
    *p = 3;
    return 4;
  }
}

then InstCombine turns the a > 0 into a != 0.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160712/8e8ced88/attachment.html>


More information about the llvm-bugs mailing list