[llvm-bugs] [Bug 28668] [InstCombine] missing folds for bit manipulation intrinsics

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 18 15:24:27 PST 2018


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Fixed By Commit(s)|                            |r277694, r349530
                 CC|                            |nikita.ppv at gmail.com
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Sanjay Patel <spatel+llvm at rotateright.com> ---
This fixes the ctlz/cttz parts of this bug:
https://reviews.llvm.org/rL349530

My comments ("all ones") in the description were incorrect - these should be
the correct folds:

define i1 @ctlz_cmp(i32 %a) {
  %cmp = icmp slt i32 %a, 0
  ret i1 %cmp
}

define i1 @cttz_cmp(i32 %a) {
  %1 = and i32 %a, 1
  %cmp = icmp ne i32 %1, 0
  ret i1 %cmp
}

-- 
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/20181218/3f8dce1c/attachment.html>


More information about the llvm-bugs mailing list