load-combine-metadata.ll 853 B

1234567891011121314151617181920212223242526272829
  1. ; RUN: opt -instcombine -S < %s | FileCheck %s
  2. target datalayout = "e-m:e-p:64:64:64-i64:64-f80:128-n8:16:32:64-S128"
  3. ; CHECK-LABEL: @test_load_load_combine_metadata(
  4. ; Check that range and AA metadata is combined
  5. ; CHECK: %[[V:.*]] = load i32, i32* %0
  6. ; CHECK-SAME: !tbaa !{{[0-9]+}}
  7. ; CHECK-SAME: !range ![[RANGE:[0-9]+]]
  8. ; CHECK: store i32 %[[V]], i32* %1
  9. ; CHECK: store i32 %[[V]], i32* %2
  10. define void @test_load_load_combine_metadata(i32*, i32*, i32*) {
  11. %a = load i32, i32* %0, !tbaa !8, !range !0, !alias.scope !5, !noalias !6
  12. %b = load i32, i32* %0, !tbaa !8, !range !1
  13. store i32 %a, i32* %1
  14. store i32 %b, i32* %2
  15. ret void
  16. }
  17. ; CHECK: ![[RANGE]] = !{i32 0, i32 1, i32 8, i32 9}
  18. !0 = !{ i32 0, i32 1 }
  19. !1 = !{ i32 8, i32 9 }
  20. !2 = !{!2}
  21. !3 = !{!3, !2}
  22. !4 = !{!4, !2}
  23. !5 = !{!3}
  24. !6 = !{!4}
  25. !7 = !{ !"tbaa root" }
  26. !8 = !{ !7, !7, i64 0 }