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

            Bug ID: 51784
           Summary: [InstCombine] Failure to fold ctpop(( v & -v ) - 1) ->
                    cttz(v, 0)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

https://alive2.llvm.org/ce/z/kopg8_

define i8 @src(i8 %0) {
%1:
  %2 = sub i8 0, %0
  %3 = and i8 %2, %0
  %4 = add i8 %3, -1
  %5 = ctpop i8 %4
  ret i8 %5
}
=>
define i8 @tgt(i8 %0) {
%1:
  %2 = cttz i8 %0, 0
  ret i8 %2
}
Transformation seems to be correct!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to