Bug ID: 41182
           Summary: TargetLowering.SimplifySetCC - missing icmp eq
                    knownbits combine
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code

define i32 @square(i32 %a0)  {
    %1 = and i32 %a0, 127
    %2 = icmp eq i32 %1, -2
    %3 = select i1 %2, i32 42, i32 -17
    ret i32 %3

square: # @square
  andl $127, %edi
  cmpl $-2, %edi
  movl $42, %ecx
  movl $-17, %eax
  cmovel %ecx, %eax

We should be able to constant fold this completely as we know that some of the
known bits will never match:

square: # @square
  movl $-17, %eax

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to