[llvm-bugs] [Bug 46013] Failure to optimize out casting in division of casted char (to int)

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 7 08:27:03 PDT 2020


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

Sanjay Patel <spatel+llvm at rotateright.com> changed:

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

--- Comment #4 from Sanjay Patel <spatel+llvm at rotateright.com> ---
Fixed in IR:
https://reviews.llvm.org/rG2552f65183eb

x86 codegen now shows:
  movl  %edi, %eax
  shrl  %eax


vs. gcc:
  movsbl %dil, %eax
  shrl %eax

Ie, we assume the 8-bit function argument is sign-extended to 32-bit as shown
in the IR from comment 1. So we don't need to explicitly set the high bits. If
that's a problem, please file a new bug for x86.

-- 
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/20200607/eb91db93/attachment.html>


More information about the llvm-bugs mailing list