• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -argpromotion -S | FileCheck %s
2; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
3
4; Don't promote around control flow.
5define internal i32 @callee(i1 %C, i32* %P) {
6; CHECK-LABEL: define internal i32 @callee(
7; CHECK: i1 %C, i32* %P)
8entry:
9  br i1 %C, label %T, label %F
10
11T:
12  ret i32 17
13
14F:
15  %X = load i32, i32* %P
16  ret i32 %X
17}
18
19define i32 @foo() {
20; CHECK-LABEL: define i32 @foo(
21entry:
22; CHECK-NOT: load i32, i32* null
23  %X = call i32 @callee(i1 true, i32* null)
24; CHECK: call i32 @callee(i1 true, i32* null)
25  ret i32 %X
26}
27
28