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

            Bug ID: 42748
           Summary: [instCombine] Suboptimal immediate size in range test
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: craig.top...@gmail.com
                CC: llvm-bugs@lists.llvm.org

This came up during the review of D65017

For this test:

define i1 @PR42691_6(i32 %x) {
; CHECK-LABEL: @PR42691_6(
; CHECK-NEXT:    [[X_OFF:%.*]] = add i32 %x, 2147483647
; CHECK-NEXT:    [[TMP1:%.*]] = icmp ugt i32 [[X_OFF]], 2147483645
; CHECK-NEXT:    ret i1 [[TMP1]]

;
  %c1 = icmp ult i32 %x, 2147483649
  %c2 = icmp eq i32 %x, 4294967295
  %c = or i1 %c1, %c2
  ret i1 %c
}

We might want to generate 

%x.off = add i32 %x, 1
%c = icmp ult i32 %x.off, -2147483646


since 1 is small constant on X86.

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

Reply via email to