1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -gvn -S | FileCheck %s
3 ; RUN: opt < %s -passes=gvn -S | FileCheck %s
7 ; CHECK-NEXT: [[B:%.*]] = freeze i1 [[A:%.*]]
8 ; CHECK-NEXT: ret i1 [[B]]
16 define void @f_multipleuses(i1 %a) {
17 ; CHECK-LABEL: @f_multipleuses(
18 ; CHECK-NEXT: [[B:%.*]] = freeze i1 [[A:%.*]]
19 ; CHECK-NEXT: call void @use1(i1 [[B]])
20 ; CHECK-NEXT: call void @use1(i1 [[B]])
21 ; CHECK-NEXT: call void @use1(i1 [[B]])
22 ; CHECK-NEXT: ret void
26 call void @use1(i1 %b)
27 call void @use1(i1 %c)
28 call void @use1(i1 %c)
32 define void @f_dom(i1 %cond, i1 %a) {
33 ; CHECK-LABEL: @f_dom(
34 ; CHECK-NEXT: br i1 [[COND:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
36 ; CHECK-NEXT: [[X:%.*]] = freeze i1 [[A:%.*]]
37 ; CHECK-NEXT: call void @use1(i1 [[X]])
38 ; CHECK-NEXT: ret void
40 ; CHECK-NEXT: [[Y:%.*]] = freeze i1 [[A]]
41 ; CHECK-NEXT: call void @use2(i1 [[Y]])
42 ; CHECK-NEXT: ret void
44 br i1 %cond, label %BB1, label %BB2
47 call void @use1(i1 %x)
51 call void @use2(i1 %y) ; cannot use %x
54 declare void @use1(i1)
55 declare void @use2(i1)