llvm.org GIT mirror llvm / 70f3668
[IR] Fix creating mutable versions of TBAA access tags Due to a typo in D41565, mutable TBAA tags created with createMutableTBAAAccessTag() lose their base types. This patch fixes that typo and updates tests respectively. Differential Revision: https://reviews.llvm.org/D42364 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325008 91177308-0d34-0410-b5e6-96231b3b80d8 Ivan A. Kosarev 1 year, 7 months ago
2 changed file(s) with 15 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
232232 }
233233
234234 MDNode *MDBuilder::createMutableTBAAAccessTag(MDNode *Tag) {
235 MDNode *BaseType = cast(Tag->getOperand(1));
235 MDNode *BaseType = cast(Tag->getOperand(0));
236236 MDNode *AccessType = cast(Tag->getOperand(1));
237237 Metadata *OffsetNode = Tag->getOperand(2);
238238 uint64_t Offset = mdconst::extract(OffsetNode)->getZExtValue();
7373 ; CHECK-LABEL: @test_md_new(
7474 ; CHECK: %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa [[TAG_new:!.*]]
7575 entry:
76 %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa !3
76 %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa !4
7777 call void @foo() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]
7878 ret i8 %tmp
7979 }
107107 ret i8 addrspace(1)* %ptr
108108 }
109109
110 !0 = !{!1, !1, i64 0, i64 1} ; TAG_old
111 !1 = !{!"type_old", !2}
112 !2 = !{!"root"}
110 !0 = !{!1, !2, i64 0, i64 1} ; TAG_old
111 !1 = !{!"type_base_old", !2, i64 0}
112 !2 = !{!"type_access_old", !3}
113 !3 = !{!"root"}
113114
114 !3 = !{!4, !4, i64 0, i64 1, i64 1} ; TAG_new
115 !4 = !{!2, i64 1, !"type_new"}
115 !4 = !{!5, !6, i64 0, i64 1, i64 1} ; TAG_new
116 !5 = !{!3, i64 1, !"type_base_new", !6, i64 0, i64 1}
117 !6 = !{!3, i64 1, !"type_access_new"}
116118
117119 ; CHECK-DAG: [[ROOT:!.*]] = !{!"root"}
118 ; CHECK-DAG: [[TYPE_old:!.*]] = !{!"type_old", [[ROOT]]}
119 ; CHECK-DAG: [[TAG_old]] = !{[[TYPE_old]], [[TYPE_old]], i64 0}
120 ; CHECK-DAG: [[TYPE_new:!.*]] = !{[[ROOT]], i64 1, !"type_new"}
121 ; CHECK-DAG: [[TAG_new]] = !{[[TYPE_new]], [[TYPE_new]], i64 0, i64 1}
120 ; CHECK-DAG: [[TYPE_access_old:!.*]] = !{!"type_access_old", [[ROOT]]}
121 ; CHECK-DAG: [[TYPE_base_old:!.*]] = !{!"type_base_old", [[TYPE_access_old]], i64 0}
122 ; CHECK-DAG: [[TAG_old]] = !{[[TYPE_base_old]], [[TYPE_access_old]], i64 0}
123 ; CHECK-DAG: [[TYPE_access_new:!.*]] = !{[[ROOT]], i64 1, !"type_access_new"}
124 ; CHECK-DAG: [[TYPE_base_new:!.*]] = !{[[ROOT]], i64 1, !"type_base_new", [[TYPE_access_new]], i64 0, i64 1}
125 ; CHECK-DAG: [[TAG_new]] = !{[[TYPE_base_new]], [[TYPE_access_new]], i64 0, i64 1}