Index: lib/IR/MDBuilder.cpp =================================================================== --- lib/IR/MDBuilder.cpp +++ lib/IR/MDBuilder.cpp @@ -233,7 +233,7 @@ } MDNode *MDBuilder::createMutableTBAAAccessTag(MDNode *Tag) { - MDNode *BaseType = cast(Tag->getOperand(1)); + MDNode *BaseType = cast(Tag->getOperand(0)); MDNode *AccessType = cast(Tag->getOperand(1)); Metadata *OffsetNode = Tag->getOperand(2); uint64_t Offset = mdconst::extract(OffsetNode)->getZExtValue(); Index: test/Transforms/RewriteStatepointsForGC/deref-pointers.ll =================================================================== --- test/Transforms/RewriteStatepointsForGC/deref-pointers.ll +++ test/Transforms/RewriteStatepointsForGC/deref-pointers.ll @@ -74,7 +74,7 @@ ; 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 + %tmp = load i8, i8 addrspace(1)* %ptr, !tbaa !4 call void @foo() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ] ret i8 %tmp } @@ -108,15 +108,19 @@ ret i8 addrspace(1)* %ptr } -!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"} +!0 = !{!1, !2, i64 0, i64 1} ; TAG_old +!1 = !{!"type_base_old", !2, i64 0} +!2 = !{!"type_access_old", !3} +!3 = !{!"root"} + +!4 = !{!5, !6, i64 0, i64 1, i64 1} ; TAG_new +!5 = !{!3, i64 1, !"type_base_new", !6, i64 0, i64 1} +!6 = !{!3, i64 1, !"type_access_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} +; CHECK-DAG: [[TYPE_access_old:!.*]] = !{!"type_access_old", [[ROOT]]} +; CHECK-DAG: [[TYPE_base_old:!.*]] = !{!"type_base_old", [[TYPE_access_old]], i64 0} +; CHECK-DAG: [[TAG_old]] = !{[[TYPE_base_old]], [[TYPE_access_old]], i64 0} +; CHECK-DAG: [[TYPE_access_new:!.*]] = !{[[ROOT]], i64 1, !"type_access_new"} +; CHECK-DAG: [[TYPE_base_new:!.*]] = !{[[ROOT]], i64 1, !"type_base_new", [[TYPE_access_new]], i64 0, i64 1} +; CHECK-DAG: [[TAG_new]] = !{[[TYPE_base_new]], [[TYPE_access_new]], i64 0, i64 1}