Home | History | Annotate | Download | only in ArgumentPromotion
      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.
      5 define internal i32 @callee(i1 %C, i32* %P) {
      6 ; CHECK-LABEL: define internal i32 @callee(
      7 ; CHECK: i1 %C, i32* %P)
      8 entry:
      9   br i1 %C, label %T, label %F
     10 
     11 T:
     12   ret i32 17
     13 
     14 F:
     15   %X = load i32, i32* %P
     16   ret i32 %X
     17 }
     18 
     19 define i32 @foo() {
     20 ; CHECK-LABEL: define i32 @foo(
     21 entry:
     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