preserve-tbaa.ll 897 B

12345678910111213141516171819202122232425262728293031
  1. ; RUN: opt -tbaa -basicaa -gvn -S < %s | FileCheck %s
  2. target datalayout = "e-p:64:64:64"
  3. ; GVN should preserve the TBAA tag on loads when doing PRE.
  4. ; CHECK-LABEL: @test(
  5. ; CHECK: %tmp33.pre = load i16, i16* %P, align 2, !tbaa !0
  6. ; CHECK: br label %for.body
  7. define void @test(i16 *%P, i16* %Q) nounwind {
  8. entry:
  9. br i1 undef, label %bb.nph, label %for.end
  10. bb.nph: ; preds = %entry
  11. br label %for.body
  12. for.body: ; preds = %for.body, %bb.nph
  13. %tmp33 = load i16, i16* %P, align 2, !tbaa !0
  14. store i16 %tmp33, i16* %Q
  15. store i16 0, i16* %P, align 2, !tbaa !0
  16. br i1 false, label %for.end, label %for.body
  17. for.end: ; preds = %for.body, %entry
  18. ret void
  19. }
  20. !0 = !{!3, !3, i64 0}
  21. !1 = !{!"omnipotent char", !2}
  22. !2 = !{!"Simple C/C++ TBAA", null}
  23. !3 = !{!"short", !1}