diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-09-27 18:34:27 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-09-27 18:34:27 +0000 |
commit | 9e81c3bdb216e7ca457acf6614591e5b807cf70c (patch) | |
tree | df0fe4a9f9a47e0dd33a3dca49eb5ed09e4ebc57 /test/Transforms/GVN | |
parent | d237e834a816399b7e1561dd4db2c501f5095712 (diff) | |
download | llvm-9e81c3bdb216e7ca457acf6614591e5b807cf70c.tar.gz llvm-9e81c3bdb216e7ca457acf6614591e5b807cf70c.tar.bz2 llvm-9e81c3bdb216e7ca457acf6614591e5b807cf70c.tar.xz |
TBAA: handle scalar TBAA format and struct-path aware TBAA format.
Remove the command line argument "struct-path-tbaa" since we should not depend
on command line argument to decide which format the IR file is using. Instead,
we check the first operand of the tbaa tag node, if it is a MDNode, we treat
it as struct-path aware TBAA format, otherwise, we treat it as scalar TBAA
format.
When clang starts to use struct-path aware TBAA format no matter whether
struct-path-tbaa is no, and we can auto-upgrade existing bc files, the support
for scalar TBAA format can be dropped.
Existing testing cases are updated to use the struct-path aware TBAA format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN')
-rw-r--r-- | test/Transforms/GVN/preserve-tbaa.ll | 3 | ||||
-rw-r--r-- | test/Transforms/GVN/tbaa.ll | 28 |
2 files changed, 21 insertions, 10 deletions
diff --git a/test/Transforms/GVN/preserve-tbaa.ll b/test/Transforms/GVN/preserve-tbaa.ll index e52772bfd9..c52ed96c23 100644 --- a/test/Transforms/GVN/preserve-tbaa.ll +++ b/test/Transforms/GVN/preserve-tbaa.ll @@ -25,6 +25,7 @@ for.end: ; preds = %for.body, %entry ret void } -!0 = metadata !{metadata !"short", metadata !1} +!0 = metadata !{metadata !3, metadata !3, i64 0} !1 = metadata !{metadata !"omnipotent char", metadata !2} !2 = metadata !{metadata !"Simple C/C++ TBAA", null} +!3 = metadata !{metadata !"short", metadata !1} diff --git a/test/Transforms/GVN/tbaa.ll b/test/Transforms/GVN/tbaa.ll index 85fe39a93b..d6412fce59 100644 --- a/test/Transforms/GVN/tbaa.ll +++ b/test/Transforms/GVN/tbaa.ll @@ -13,7 +13,7 @@ define i32 @test1(i8* %p, i8* %q) { define i32 @test2(i8* %p, i8* %q) { ; CHECK: @test2(i8* %p, i8* %q) -; CHECK: call i32 @foo(i8* %p), !tbaa !0 +; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGC:!.*]] ; CHECK: %c = add i32 %a, %a %a = call i32 @foo(i8* %p), !tbaa !0 %b = call i32 @foo(i8* %p), !tbaa !0 @@ -23,7 +23,7 @@ define i32 @test2(i8* %p, i8* %q) { define i32 @test3(i8* %p, i8* %q) { ; CHECK: @test3(i8* %p, i8* %q) -; CHECK: call i32 @foo(i8* %p), !tbaa !3 +; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGB:!.*]] ; CHECK: %c = add i32 %a, %a %a = call i32 @foo(i8* %p), !tbaa !3 %b = call i32 @foo(i8* %p), !tbaa !3 @@ -33,7 +33,7 @@ define i32 @test3(i8* %p, i8* %q) { define i32 @test4(i8* %p, i8* %q) { ; CHECK: @test4(i8* %p, i8* %q) -; CHECK: call i32 @foo(i8* %p), !tbaa !1 +; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGA:!.*]] ; CHECK: %c = add i32 %a, %a %a = call i32 @foo(i8* %p), !tbaa !1 %b = call i32 @foo(i8* %p), !tbaa !0 @@ -43,7 +43,7 @@ define i32 @test4(i8* %p, i8* %q) { define i32 @test5(i8* %p, i8* %q) { ; CHECK: @test5(i8* %p, i8* %q) -; CHECK: call i32 @foo(i8* %p), !tbaa !1 +; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGA:!.*]] ; CHECK: %c = add i32 %a, %a %a = call i32 @foo(i8* %p), !tbaa !0 %b = call i32 @foo(i8* %p), !tbaa !1 @@ -53,7 +53,7 @@ define i32 @test5(i8* %p, i8* %q) { define i32 @test6(i8* %p, i8* %q) { ; CHECK: @test6(i8* %p, i8* %q) -; CHECK: call i32 @foo(i8* %p), !tbaa !1 +; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGA:!.*]] ; CHECK: %c = add i32 %a, %a %a = call i32 @foo(i8* %p), !tbaa !0 %b = call i32 @foo(i8* %p), !tbaa !3 @@ -74,8 +74,18 @@ define i32 @test7(i8* %p, i8* %q) { declare i32 @foo(i8*) readonly -!0 = metadata !{metadata !"C", metadata !1} -!1 = metadata !{metadata !"A", metadata !2} +; CHECK: [[TAGC]] = metadata !{metadata [[TYPEC:!.*]], metadata [[TYPEC]], i64 0} +; CHECK: [[TYPEC]] = metadata !{metadata !"C", metadata [[TYPEA:!.*]]} +; CHECK: [[TYPEA]] = metadata !{metadata !"A", metadata !{{.*}}} +; CHECK: [[TAGB]] = metadata !{metadata [[TYPEB:!.*]], metadata [[TYPEB]], i64 0} +; CHECK: [[TYPEB]] = metadata !{metadata !"B", metadata [[TYPEA]]} +; CHECK: [[TAGA]] = metadata !{metadata [[TYPEA]], metadata [[TYPEA]], i64 0} +!0 = metadata !{metadata !5, metadata !5, i64 0} +!1 = metadata !{metadata !6, metadata !6, i64 0} !2 = metadata !{metadata !"tbaa root", null} -!3 = metadata !{metadata !"B", metadata !1} -!4 = metadata !{metadata !"another root", null} +!3 = metadata !{metadata !7, metadata !7, i64 0} +!4 = metadata !{metadata !8, metadata !8, i64 0} +!5 = metadata !{metadata !"C", metadata !6} +!6 = metadata !{metadata !"A", metadata !2} +!7 = metadata !{metadata !"B", metadata !6} +!8 = metadata !{metadata !"another root", null} |