brintos

brintos / llvm-project-archived public Read only

0
0
Text · 683 B · c8077cf Raw
22 lines · plain
1; RUN: opt < %s -passes=mem2reg -S | FileCheck %s2 3; This function is optnone, so the allocas should not be eliminated.4 5; CHECK-LABEL: @testfunc6; CHECK: alloca7; CHECK: alloca8define double @testfunc(i32 %i, double %j) optnone noinline {9	%I = alloca i32		; <ptr> [#uses=4]10	%J = alloca double		; <ptr> [#uses=2]11	store i32 %i, ptr %I12	store double %j, ptr %J13	%t1 = load i32, ptr %I		; <i32> [#uses=1]14	%t2 = add i32 %t1, 1		; <i32> [#uses=1]15	store i32 %t2, ptr %I16	%t3 = load i32, ptr %I		; <i32> [#uses=1]17	%t4 = sitofp i32 %t3 to double		; <double> [#uses=1]18	%t5 = load double, ptr %J		; <double> [#uses=1]19	%t6 = fmul double %t4, %t5		; <double> [#uses=1]20	ret double %t621}22