apint-load.ll 941 B

123456789101112131415161718192021222324252627282930313233343536
  1. ; This test makes sure that these instructions are properly constant propagated.
  2. ; RUN: opt < %s -ipsccp -S | not grep load
  3. ; RUN: opt < %s -ipsccp -S | not grep fdiv
  4. @X = constant i212 42
  5. @Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 },
  6. { i212, float } { i212 37, float 0x3FF3B2FEC0000000 } ]
  7. define i212 @test1() {
  8. %B = load i212, i212* @X
  9. ret i212 %B
  10. }
  11. define internal float @test2() {
  12. %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1
  13. %B = load float, float* %A
  14. ret float %B
  15. }
  16. define internal i212 @test3() {
  17. %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 0, i32 0
  18. %B = load i212, i212* %A
  19. ret i212 %B
  20. }
  21. define float @All()
  22. {
  23. %A = call float @test2()
  24. %B = call i212 @test3()
  25. %C = mul i212 %B, -1234567
  26. %D = sitofp i212 %C to float
  27. %E = fdiv float %A, %D
  28. ret float %E
  29. }