brintos

brintos / llvm-project-archived public Read only

0
0
Text · 912 B · d639f22 Raw
37 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 fdiv5 6@X = constant i212 427@Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, 8                                     { i212, float } { i212 37, float 0x3FF3B2FEC0000000 } ]9define i212 @test1() {10	%B = load i212, ptr @X11	ret i212 %B12}13 14define internal float @test2() {15	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 1, i32 116	%B = load float, ptr %A17	ret float %B18}19 20define internal i212 @test3() {21	%A = getelementptr [2 x { i212, float}], ptr @Y, i32 0, i32 0, i32 022	%B = load i212, ptr %A23	ret i212 %B24}25 26define float @All()27{28   %A = call float @test2()29   %B = call i212 @test3()30   %C = mul i212 %B, -123456731   %D = sitofp i212 %C to float32   %E = fdiv float %A, %D33   ret float %E34}35 36 37