brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · e080c6b Raw
50 lines · plain
1; This test makes sure that these instructions are properly constant propagated.2 3; RUN: opt < %s -passes=ipsccp -S | not grep load4; RUN: opt < %s -passes=ipsccp -S | not grep add5; RUN: opt < %s -passes=ipsccp -S | not grep phi6 7 8@Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, 9                                     { i212, float } { i212 37, float 2.0 } ]10 11define internal float @test2() {12	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 1, i32 113	%B = load float, ptr %A14	ret float %B15}16 17define internal float  @test3() {18	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 0, i32 119	%B = load float, ptr %A20	ret float %B21}22 23define internal float @test()24{25   %A = call float @test2()26   %B = call float @test3()27 28   %E = fdiv float %B, %A29   ret float %E30}31 32define float @All()33{34  %A = call float @test()35  %B = fcmp oge float %A, 1.036  br i1 %B, label %T, label %F37T:38  %C = fadd float %A, 1.039  br label %exit40F:41  %D = fadd float %A, 2.042  br label %exit43exit:44  %E = phi float [%C, %T], [%D, %F]45  ret float %E46}47 48 49 50