brintos

brintos / llvm-project-archived public Read only

0
0
Text · 707 B · f8c838c Raw
22 lines · plain
1; Simple basic correctness check testcase.  Both alloca's should be eliminated.2; RUN: opt < %s -passes='debugify,mem2reg,check-debugify' -S 2>&1 | FileCheck %s3 4; CHECK-NOT: alloca5; CHECK: CheckModuleDebugify: PASS6 7define double @testfunc(i32 %i, double %j) {8	%I = alloca i32		; <ptr> [#uses=4]9	%J = alloca double		; <ptr> [#uses=2]10	store i32 %i, ptr %I11	store double %j, ptr %J12	%t1 = load i32, ptr %I		; <i32> [#uses=1]13	%t2 = add i32 %t1, 1		; <i32> [#uses=1]14	store i32 %t2, ptr %I15	%t3 = load i32, ptr %I		; <i32> [#uses=1]16	%t4 = sitofp i32 %t3 to double		; <double> [#uses=1]17	%t5 = load double, ptr %J		; <double> [#uses=1]18	%t6 = fmul double %t4, %t5		; <double> [#uses=1]19	ret double %t620}21 22