1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=gvn -S | FileCheck %s
6 ; CHECK-NEXT: [[B:%.*]] = freeze i1 [[A:%.*]]
7 ; CHECK-NEXT: ret i1 [[B]]
15 define void @f_multipleuses(i1 %a) {
16 ; CHECK-LABEL: @f_multipleuses(
17 ; CHECK-NEXT: [[B:%.*]] = freeze i1 [[A:%.*]]
18 ; CHECK-NEXT: call void @use1(i1 [[B]])
19 ; CHECK-NEXT: call void @use1(i1 [[B]])
20 ; CHECK-NEXT: call void @use1(i1 [[B]])
21 ; CHECK-NEXT: ret void
25 call void @use1(i1 %b)
26 call void @use1(i1 %c)
27 call void @use1(i1 %c)
31 define void @f_dom(i1 %cond, i1 %a) {
32 ; CHECK-LABEL: @f_dom(
33 ; CHECK-NEXT: br i1 [[COND:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
35 ; CHECK-NEXT: [[X:%.*]] = freeze i1 [[A:%.*]]
36 ; CHECK-NEXT: call void @use1(i1 [[X]])
37 ; CHECK-NEXT: ret void
39 ; CHECK-NEXT: [[Y:%.*]] = freeze i1 [[A]]
40 ; CHECK-NEXT: call void @use2(i1 [[Y]])
41 ; CHECK-NEXT: ret void
43 br i1 %cond, label %BB1, label %BB2
46 call void @use1(i1 %x)
50 call void @use2(i1 %y) ; cannot use %x
53 declare void @use1(i1)
54 declare void @use2(i1)