Home | History | Annotate | Download | only in Inline
      1 ; RUN: opt < %s -inline -S | grep call
      2 ; Do not inline calls to variable-sized alloca.
      3 
      4 @q = common global i8* null		; <i8**> [#uses=1]
      5 
      6 define i8* @a(i32 %i) nounwind {
      7 entry:
      8 	%i_addr = alloca i32		; <i32*> [#uses=2]
      9 	%retval = alloca i8*		; <i8**> [#uses=1]
     10 	%p = alloca i8*		; <i8**> [#uses=2]
     11 	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
     12 	store i32 %i, i32* %i_addr
     13 	%0 = load i32* %i_addr, align 4		; <i32> [#uses=1]
     14 	%1 = alloca i8, i32 %0		; <i8*> [#uses=1]
     15 	store i8* %1, i8** %p, align 4
     16 	%2 = load i8** %p, align 4		; <i8*> [#uses=1]
     17 	store i8* %2, i8** @q, align 4
     18 	br label %return
     19 
     20 return:		; preds = %entry
     21 	%retval1 = load i8** %retval		; <i8*> [#uses=1]
     22 	ret i8* %retval1
     23 }
     24 
     25 define void @b(i32 %i) nounwind {
     26 entry:
     27 	%i_addr = alloca i32		; <i32*> [#uses=2]
     28 	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
     29 	store i32 %i, i32* %i_addr
     30 	%0 = load i32* %i_addr, align 4		; <i32> [#uses=1]
     31 	%1 = call i8* @a(i32 %0) nounwind		; <i8*> [#uses=0]
     32 	br label %return
     33 
     34 return:		; preds = %entry
     35 	ret void
     36 }
     37