diff options
author | Ivan A. Kosarev <ikosarev@accesssoftek.com> | 2018-01-17 13:29:54 +0000 |
---|---|---|
committer | Ivan A. Kosarev <ikosarev@accesssoftek.com> | 2018-01-17 13:29:54 +0000 |
commit | 4d0ff0c74d35e6c5bfc60c3864e8ac7655737f8f (patch) | |
tree | cd04e83e4347d59bb006b3b185a783c9ab9eb16b /llvm/test/Transforms/RewriteStatepointsForGC | |
parent | b87c8fa45634968526d140a586efeb194fa13ac9 (diff) | |
download | bcm5719-llvm-4d0ff0c74d35e6c5bfc60c3864e8ac7655737f8f.tar.gz bcm5719-llvm-4d0ff0c74d35e6c5bfc60c3864e8ac7655737f8f.zip |
[Transforms] Support making mutable versions of new-format TBAA access tags
Differential Revision: https://reviews.llvm.org/D41565
llvm-svn: 322650
Diffstat (limited to 'llvm/test/Transforms/RewriteStatepointsForGC')
-rw-r--r-- | llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll b/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll index d08da73887a..69dbf6f0af6 100644 --- a/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll +++ b/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll @@ -62,13 +62,23 @@ entry: define i8 @test_md(i8 addrspace(1)* %ptr) gc "statepoint-example" { ; CHECK-LABEL: @test_md( -; CHECK: %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa !0 +; CHECK: %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa [[TAG_old:!.*]] entry: %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa !0 call void @foo() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ] ret i8 %tmp } +; Same as test_md() above, but with new-format TBAA metadata. +define i8 @test_md_new(i8 addrspace(1)* %ptr) gc "statepoint-example" { +; CHECK-LABEL: @test_md_new( +; CHECK: %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa [[TAG_new:!.*]] +entry: + %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa !3 + call void @foo() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ] + ret i8 %tmp +} + define i8 addrspace(1)* @test_decl_only_attribute(i8 addrspace(1)* %ptr) gc "statepoint-example" { ; CHECK-LABEL: @test_decl_only_attribute( ; No change here, but the prototype of some_function_ret_deref should have changed. @@ -92,14 +102,21 @@ entry: define i8 addrspace(1)* @test_callsite_arg_attribute(i8 addrspace(1)* %ptr) gc "statepoint-example" { ; CHECK-LABEL: @test_callsite_arg_attribute( ; CHECK: call void @some_function_consumer(i8 addrspace(1)* %ptr) -; CHECK: !0 = !{!1, !1, i64 0} -; CHECK: !1 = !{!"red", !2} -; CHECK: !2 = !{!"blue"} entry: call void @some_function_consumer(i8 addrspace(1)* dereferenceable(4) noalias %ptr) call void @foo() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ] ret i8 addrspace(1)* %ptr } -!0 = !{!1, !1, i64 0, i64 1} -!1 = !{!"red", !2} -!2 = !{!"blue"} + +!0 = !{!1, !1, i64 0, i64 1} ; TAG_old +!1 = !{!"type_old", !2} +!2 = !{!"root"} + +!3 = !{!4, !4, i64 0, i64 1, i64 1} ; TAG_new +!4 = !{!2, i64 1, !"type_new"} + +; CHECK-DAG: [[ROOT:!.*]] = !{!"root"} +; CHECK-DAG: [[TYPE_old:!.*]] = !{!"type_old", [[ROOT]]} +; CHECK-DAG: [[TAG_old]] = !{[[TYPE_old]], [[TYPE_old]], i64 0} +; CHECK-DAG: [[TYPE_new:!.*]] = !{[[ROOT]], i64 1, !"type_new"} +; CHECK-DAG: [[TAG_new]] = !{[[TYPE_new]], [[TYPE_new]], i64 0, i64 1} |