Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: test/Transforms/NaCl/strip-tbaa-metadata.ll

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 ; RUN: opt -S -strip-metadata %s | FileCheck %s 1 ; RUN: opt -S -strip-metadata %s | FileCheck %s
2 2
3 ; Test that !tbaa is removed from loads/stores. 3 ; Test that !tbaa is removed from loads/stores.
4 ; CHECK: @foo 4 ; CHECK: @foo
5 ; CHECK-NOT: !tbaa 5 ; CHECK-NOT: !tbaa
6 define double @foo(i32* nocapture %ptr1, double* nocapture %ptr2) nounwind reado nly { 6 define double @foo(i32* nocapture %ptr1, double* nocapture %ptr2) nounwind reado nly {
7 store i32 99999, i32* %ptr1, align 1, !tbaa !0 7 store i32 99999, i32* %ptr1, align 1, !tbaa !0
8 %1 = load double* %ptr2, align 8, !tbaa !3 8 %1 = load double, double* %ptr2, align 8, !tbaa !3
9 ret double %1 9 ret double %1
10 } 10 }
11 11
12 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind 12 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
13 13
14 ; Test that !tbaa is removed from calls. 14 ; Test that !tbaa is removed from calls.
15 ; CHECK: @bar 15 ; CHECK: @bar
16 ; CHECK-NOT: !tbaa 16 ; CHECK-NOT: !tbaa
17 define void @bar(i8* nocapture %p, i8* nocapture %q, 17 define void @bar(i8* nocapture %p, i8* nocapture %q,
18 i8* nocapture %s) nounwind { 18 i8* nocapture %s) nounwind {
19 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, 19 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q,
20 i64 16, i32 1, i1 false), !tbaa !4 20 i64 16, i32 1, i1 false), !tbaa !4
21 store i8 2, i8* %s, align 1, !tbaa !5 21 store i8 2, i8* %s, align 1, !tbaa !5
22 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %q, i8* %p, 22 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %q, i8* %p,
23 i64 16, i32 1, i1 false), !tbaa !4 23 i64 16, i32 1, i1 false), !tbaa !4
24 ; CHECK ret void 24 ; CHECK ret void
25 ret void 25 ret void
26 } 26 }
27 27
28 ; Test that the metadata nodes aren't left over. 28 ; Test that the metadata nodes aren't left over.
29 ; CHECK-NOT: !0 = 29 ; CHECK-NOT: !0 =
30 30
31 !0 = metadata !{metadata !"int", metadata !1} 31 !0 = !{!"int", !1}
32 !1 = metadata !{metadata !"omnipotent char", metadata !2} 32 !1 = !{!"omnipotent char", !2}
33 !2 = metadata !{metadata !"Simple C/C++ TBAA"} 33 !2 = !{!"Simple C/C++ TBAA"}
34 !3 = metadata !{metadata !"double", metadata !1} 34 !3 = !{!"double", !1}
35 !4 = metadata !{metadata !"A", metadata !1} 35 !4 = !{!"A", !1}
36 !5 = metadata !{metadata !"B", metadata !1} 36 !5 = !{!"B", !1}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698