aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/PhaseOrdering/func-attrs.ll
blob: 187e32afe00a348c390c2a40f15db6d35db7077a (plain)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes
; RUN: opt -O2 -S < %s | FileCheck %s

declare void @g()

define internal i32 @h1(i32 %a, i32 %b) {
  %c = add i32 %a, %b
  %c2 = add i32 2, %c
  ret i32 %c2
}

define internal i32 @h2(i32 %a, i32 %b) {
  %c = add i32 %a, %b
  %c2 = add i32 2, %c
  ret i32 %c2
}

define void @f(i32 %a, i32 %b) noinline {
; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: @f(
; CHECK-NEXT:  end:
; CHECK-NEXT:    ret void
;
  %c = call i32 @h1(i32 %a, i32 %b)
  %d = call i32 @h2(i32 %a, i32 %b)
  %i = icmp eq i32 %c, %d
  br i1 %i, label %end, label %dead
dead:
  call void @g()
  br label %end
end:
  ret void
}