• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -mem2reg -S | FileCheck %s
2
3; This function is optnone, so the allocas should not be eliminated.
4
5; CHECK-LABEL: @testfunc
6; CHECK: alloca
7; CHECK: alloca
8define double @testfunc(i32 %i, double %j) optnone noinline {
9	%I = alloca i32		; <i32*> [#uses=4]
10	%J = alloca double		; <double*> [#uses=2]
11	store i32 %i, i32* %I
12	store double %j, double* %J
13	%t1 = load i32, i32* %I		; <i32> [#uses=1]
14	%t2 = add i32 %t1, 1		; <i32> [#uses=1]
15	store i32 %t2, i32* %I
16	%t3 = load i32, i32* %I		; <i32> [#uses=1]
17	%t4 = sitofp i32 %t3 to double		; <double> [#uses=1]
18	%t5 = load double, double* %J		; <double> [#uses=1]
19	%t6 = fmul double %t4, %t5		; <double> [#uses=1]
20	ret double %t6
21}
22