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

            Bug ID: 28665
           Summary: [InstSimplify] missing analysis for bit manipulation
                    intrinsics
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: spatel+l...@rotateright.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

define i1 @ctlz_cmp_false(i32 %a) {
  %x = tail call i32 @llvm.ctlz.i32(i32 %a, i1 false) nounwind readnone
  %cmp = icmp ugt i32 %x, 32
  ret i1 %cmp
}

define i1 @cttz_cmp_false(i32 %a) {
  %x = tail call i32 @llvm.cttz.i32(i32 %a, i1 false) nounwind readnone
  %cmp = icmp ugt i32 %x, 32
  ret i1 %cmp
}

define i1 @ctpop_cmp_false(i32 %a) {
  %x = tail call i32 @llvm.ctpop.i32(i32 %a) nounwind readnone
  %cmp = icmp ugt i32 %x, 32
  ret i1 %cmp
}

declare i32 @llvm.cttz.i32(i32, i1) nounwind readnone
declare i32 @llvm.ctlz.i32(i32, i1) nounwind readnone
declare i32 @llvm.ctpop.i32(i32) nounwind readnone


-----------------------------------------------------------------------------

$ ./opt -instsimplify bitz.ll -S

(doesn't change anything)

Note that this does work:

define i1 @ctlz_cmp_true(i32 %a) {
  %x = tail call i32 @llvm.ctlz.i32(i32 %a, i1 false) nounwind readnone
  %cmp = icmp uge i32 %x, 0
  ret i1 %cmp
}

$ ./opt -instsimplify bitz.ll -S
...
define i1 @ctlz_cmp_true(i32 %a) {
  ret i1 true
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to