1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 define i32 @assume_add(i32 %a, i32 %b) {
5 ; CHECK-LABEL: @assume_add(
6 ; CHECK-NEXT: [[T1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
7 ; CHECK-NEXT: [[LAST_TWO_DIGITS:%.*]] = and i32 [[T1]], 3
8 ; CHECK-NEXT: [[T2:%.*]] = icmp eq i32 [[LAST_TWO_DIGITS]], 0
9 ; CHECK-NEXT: call void @llvm.assume(i1 [[T2]])
10 ; CHECK-NEXT: [[T3:%.*]] = or i32 [[T1]], 3
11 ; CHECK-NEXT: ret i32 [[T3]]
14 %last_two_digits = and i32 %t1, 3
15 %t2 = icmp eq i32 %last_two_digits, 0
16 call void @llvm.assume(i1 %t2)
22 define void @assume_not() {
23 ; CHECK-LABEL: @assume_not(
25 %0 = call i1 @get_val()
26 ; CHECK: call void @llvm.assume
28 call void @llvm.assume(i1 %1)
33 declare void @llvm.assume(i1)