[llvm-bugs] [Bug 43428] Missed optimization: int range info isn't used

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 13 12:40:32 PST 2020


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

Nikita Popov <nikita.ppv at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nikita.ppv at gmail.com
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Nikita Popov <nikita.ppv at gmail.com> ---
Codegen on trunk:

sample(unsigned int): # @sample(unsigned int)
  xor ecx, ecx
  cmp edi, 9
  mov eax, 42
  cmovbe eax, ecx
  ret

Can't really comment on the precise instruction choice, but the optimization to
"m >= 10 ? 42 : 0" is happening now, which I assume was the main concern here.

-- 
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/20201213/4e3250d2/attachment.html>


More information about the llvm-bugs mailing list