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