• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Simple sanity check testcase.  Both alloca's should be eliminated.
2; RUN: opt < %s -mem2reg -S | not grep alloca
3
4define double @testfunc(i32 %i, double %j) {
5	%I = alloca i32		; <i32*> [#uses=4]
6	%J = alloca double		; <double*> [#uses=2]
7	store i32 %i, i32* %I
8	store double %j, double* %J
9	%t1 = load i32* %I		; <i32> [#uses=1]
10	%t2 = add i32 %t1, 1		; <i32> [#uses=1]
11	store i32 %t2, i32* %I
12	%t3 = load i32* %I		; <i32> [#uses=1]
13	%t4 = sitofp i32 %t3 to double		; <double> [#uses=1]
14	%t5 = load double* %J		; <double> [#uses=1]
15	%t6 = fmul double %t4, %t5		; <double> [#uses=1]
16	ret double %t6
17}
18
19