469469define void @hoist_captures_overlap (i1 %c , ptr %x , ptr %y ) {
470470; CHECK-LABEL: @hoist_captures_overlap(
471471; CHECK-NEXT: if:
472- ; CHECK-NEXT: store ptr [[X:%.*]], ptr [[Y:%.*]], align 8, !captures [[META11:![0-9]+ ]]
472+ ; CHECK-NEXT: store ptr [[X:%.*]], ptr [[Y:%.*]], align 8, !captures [[META10 ]]
473473; CHECK-NEXT: ret void
474474;
475475if:
@@ -487,12 +487,52 @@ out:
487487 ret void
488488}
489489
490- ; We could also omit the attribute in this case, as it provides no additional
491- ; information.
490+ define void @hoist_captures_subsume1 (i1 %c , ptr %x , ptr %y ) {
491+ ; CHECK-LABEL: @hoist_captures_subsume1(
492+ ; CHECK-NEXT: if:
493+ ; CHECK-NEXT: store ptr [[X:%.*]], ptr [[Y:%.*]], align 8, !captures [[META9]]
494+ ; CHECK-NEXT: ret void
495+ ;
496+ if:
497+ br i1 %c , label %then , label %else
498+
499+ then:
500+ store ptr %x , ptr %y , !captures !{!"address_is_null" }
501+ br label %out
502+
503+ else:
504+ store ptr %x , ptr %y , !captures !{!"address" }
505+ br label %out
506+
507+ out:
508+ ret void
509+ }
510+
511+ define void @hoist_captures_subsume2 (i1 %c , ptr %x , ptr %y ) {
512+ ; CHECK-LABEL: @hoist_captures_subsume2(
513+ ; CHECK-NEXT: if:
514+ ; CHECK-NEXT: store ptr [[X:%.*]], ptr [[Y:%.*]], align 8, !captures [[META11:![0-9]+]]
515+ ; CHECK-NEXT: ret void
516+ ;
517+ if:
518+ br i1 %c , label %then , label %else
519+
520+ then:
521+ store ptr %x , ptr %y , !captures !{!"provenance" }
522+ br label %out
523+
524+ else:
525+ store ptr %x , ptr %y , !captures !{!"read_provenance" }
526+ br label %out
527+
528+ out:
529+ ret void
530+ }
531+
492532define void @hoist_captures_full_set (i1 %c , ptr %x , ptr %y ) {
493533; CHECK-LABEL: @hoist_captures_full_set(
494534; CHECK-NEXT: if:
495- ; CHECK-NEXT: store ptr [[X:%.*]], ptr [[Y:%.*]], align 8, !captures [[META12:![0-9]+]]
535+ ; CHECK-NEXT: store ptr [[X:%.*]], ptr [[Y:%.*]], align 8
496536; CHECK-NEXT: ret void
497537;
498538if:
574614; CHECK: [[META7]] = !{i32 5, i32 6}
575615; CHECK: [[META8]] = !{i32 4, i32 5}
576616; CHECK: [[META9]] = !{!"address"}
577- ; CHECK: [[META10]] = !{!"read_provenance", !"address"}
578- ; CHECK: [[META11]] = !{!"address", !"read_provenance"}
579- ; CHECK: [[META12]] = !{!"provenance", !"address"}
617+ ; CHECK: [[META10]] = !{!"address", !"read_provenance"}
618+ ; CHECK: [[META11]] = !{!"provenance"}
580619;.
0 commit comments