apint-array.ll 592 B

1234567891011121314151617181920212223
  1. ; RUN: opt < %s -sccp -S | grep "ret i101 12"
  2. @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,i101
  3. -123456789000000, i101 0,i101 9123456789000000]
  4. define i101 @array()
  5. {
  6. Head:
  7. %A = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 1
  8. %B = load i101, i101* %A
  9. %C = icmp sge i101 %B, 1
  10. br i1 %C, label %True, label %False
  11. True:
  12. %D = and i101 %B, 1
  13. %E = trunc i101 %D to i32
  14. %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 %E
  15. %G = load i101, i101* %F
  16. br label %False
  17. False:
  18. %H = phi i101 [%G, %True], [-1, %Head]
  19. ret i101 %H
  20. }