assume.ll
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -gvn -S | FileCheck %s
declare void @llvm.assume(i1)
declare void @use(i1)
define void @assume_arg(i1 %x) {
; CHECK-LABEL: @assume_arg(
; CHECK-NEXT: call void @llvm.assume(i1 [[X:%.*]])
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
call void @llvm.assume(i1 %x)
call void @use(i1 %x)
ret void
}
define void @assume_not_arg(i1 %x) {
; CHECK-LABEL: @assume_not_arg(
; CHECK-NEXT: [[XOR:%.*]] = xor i1 [[X:%.*]], true
; CHECK-NEXT: call void @llvm.assume(i1 [[XOR]])
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: ret void
;
%xor = xor i1 %x, true
call void @llvm.assume(i1 %xor)
call void @use(i1 %x)
ret void
}
define void @pr47496(i8 %x) {
; CHECK-LABEL: @pr47496(
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[X:%.*]], 0
; CHECK-NEXT: [[XOR:%.*]] = xor i1 [[CMP]], true
; CHECK-NEXT: call void @llvm.assume(i1 [[XOR]])
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: ret void
;
%cmp = icmp slt i8 %x, 0
%xor = xor i1 %cmp, true
call void @llvm.assume(i1 %xor)
call void @use(i1 %cmp)
ret void
}