; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp ult i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_ULT:%.*]] = icmp ult i32 [[EL]], [[LEN]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_ULT]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.ult = icmp ult i32 %el, %len
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.ult, %wc
; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp slt i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_SLT:%.*]] = icmp slt i32 [[EL]], [[LEN]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_SLT]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.slt = icmp slt i32 %el, %len
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.slt, %wc
; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp ult i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_ULE:%.*]] = icmp ule i32 [[EL]], [[LEN]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_ULE]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.ule = icmp ule i32 %el, %len
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.ule, %wc
; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp slt i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_SLE:%.*]] = icmp sle i32 [[EL]], [[LEN]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_SLE]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.sle = icmp sle i32 %el, %len
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.sle, %wc
; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp ult i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_SLE:%.*]] = icmp ugt i32 [[LEN]], [[EL]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_SLE]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.sle = icmp ugt i32 %len, %el
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.sle, %wc
; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp ult i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_SLE:%.*]] = icmp uge i32 [[LEN]], [[EL]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_SLE]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.sle = icmp uge i32 %len, %el
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.sle, %wc
; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp slt i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_SLE:%.*]] = icmp sgt i32 [[LEN]], [[EL]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_SLE]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.sle = icmp sgt i32 %len, %el
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.sle, %wc
; CHECK-NEXT: [[BOUND_CHECK:%.*]] = icmp slt i32 [[EL]], 128
; CHECK-NEXT: br i1 [[BOUND_CHECK]], label [[DO_RANGE_CHECK:%.*]], label [[BOUND_CHECK_FAILED:%.*]]
; CHECK: do_range_check:
+; CHECK-NEXT: call void @llvm.assume(i1 [[BOUND_CHECK]])
; CHECK-NEXT: [[RANGE_CHECK_SLE:%.*]] = icmp sge i32 [[LEN]], [[EL]]
; CHECK-NEXT: [[WC:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[EXPLICIT_GUARD_COND:%.*]] = and i1 [[RANGE_CHECK_SLE]], [[WC]]
br i1 %bound_check, label %do_range_check, label %bound_check_failed
do_range_check:
+ call void @llvm.assume(i1 %bound_check)
%range_check.sle = icmp sge i32 %len, %el
%wc = call i1 @llvm.experimental.widenable.condition()
%explicit_guard_cond = and i1 %range_check.sle, %wc
declare i32 @llvm.experimental.deoptimize.i32(...)
+declare void @llvm.assume(i1)
+
attributes #1 = { inaccessiblememonly nocallback nofree nosync nounwind speculatable willreturn }
!0 = !{}