1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -O3 -S < %s | FileCheck %s
3 ; RUN: opt -passes='default<O3>' -S < %s | FileCheck %s
5 define void @PR45682(i32 %x, i32 %y) {
6 ; CHECK-LABEL: @PR45682(
8 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[Y:%.*]], 0
9 ; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
10 ; CHECK-NEXT: ret void
13 %x.addr = alloca i32, align 4
14 %y.addr = alloca i32, align 4
15 store i32 %x, ptr %x.addr, align 4
16 store i32 %y, ptr %y.addr, align 4
17 %0 = load i32, ptr %y.addr, align 4
18 %cmp = icmp sgt i32 %0, 0
19 call void @llvm.assume(i1 %cmp)
20 %1 = load i32, ptr %y.addr, align 4
21 %2 = load i32, ptr %x.addr, align 4
22 %add = add nsw i32 %2, %1
23 store i32 %add, ptr %x.addr, align 4
24 %3 = load i32, ptr %x.addr, align 4
25 %cmp1 = icmp eq i32 %3, -2147483648
26 br i1 %cmp1, label %if.then, label %if.end
37 declare void @llvm.assume(i1)