1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt %s -simplifycfg -instcombine -S | FileCheck %s
4 define i32 @assume1(i32 %p) {
5 ; CHECK-LABEL: @assume1(
7 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[P:%.*]], 0
8 ; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
9 ; CHECK-NEXT: ret i32 [[P]]
12 %cmp = icmp sle i32 %p, 0
13 br i1 %cmp, label %if.then, label %if.end
19 %call = call i32 @abs(i32 %p)
24 define i32 @assume2(i32 %p) {
25 ; CHECK-LABEL: @assume2(
27 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[P:%.*]], 0
28 ; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
29 ; CHECK-NEXT: ret i32 [[P]]
32 %cmp = icmp sgt i32 %p, 0
33 br i1 %cmp, label %if.then, label %if.else
42 %call = call i32 @abs(i32 %p)