|
| 1 | +; RUN: llc %s -mtriple=aarch64-eabi -stop-after=finalize-isel -o - | FileCheck --check-prefix=MIR %s |
| 2 | + |
| 3 | +; Ensure the scoped AA metadata is still retained after store merging. |
| 4 | + |
| 5 | +; MIR-DAG: ![[DOMAIN:[0-9]+]] = distinct !{!{{[0-9]+}}, !"domain"} |
| 6 | +; MIR-DAG: ![[SCOPE0:[0-9]+]] = distinct !{!{{[0-9]+}}, ![[DOMAIN]], !"scope 0"} |
| 7 | +; MIR-DAG: ![[SCOPE1:[0-9]+]] = distinct !{!{{[0-9]+}}, ![[DOMAIN]], !"scope 1"} |
| 8 | +; MIR-DAG: ![[SCOPE2:[0-9]+]] = distinct !{!{{[0-9]+}}, ![[DOMAIN]], !"scope 2"} |
| 9 | +; MIR-DAG: ![[SCOPE3:[0-9]+]] = distinct !{!{{[0-9]+}}, ![[DOMAIN]], !"scope 3"} |
| 10 | +; MIR-DAG: ![[SET0:[0-9]+]] = !{![[SCOPE0]]} |
| 11 | +; MIR-DAG: ![[SET1:[0-9]+]] = !{![[SCOPE1]]} |
| 12 | +; MIR-DAG: ![[SET2:[0-9]+]] = !{![[SCOPE2]]} |
| 13 | +; MIR-DAG: ![[SET3:[0-9]+]] = !{![[SCOPE3]]} |
| 14 | + |
| 15 | +define void @blam0(<3 x float>* %g0, <3 x float>* %g1) { |
| 16 | +; MIR-LABEL: name: blam0 |
| 17 | +; MIR: LDRDui %0, 0 :: (load (s64) from %ir.g0, align 4, !alias.scope ![[SET0]], !noalias ![[SET1]]) |
| 18 | +; MIR: STRDui killed %5, %1, 0 :: (store (s64) into %ir.tmp41, align 4, !alias.scope ![[SET1]], !noalias ![[SET0]]) |
| 19 | + %tmp4 = getelementptr inbounds <3 x float>, <3 x float>* %g1, i64 0, i64 0 |
| 20 | + %tmp5 = load <3 x float>, <3 x float>* %g0, align 4, !alias.scope !0, !noalias !1 |
| 21 | + %tmp6 = extractelement <3 x float> %tmp5, i64 0 |
| 22 | + store float %tmp6, float* %tmp4, align 4, !alias.scope !1, !noalias !0 |
| 23 | + %tmp7 = getelementptr inbounds float, float* %tmp4, i64 1 |
| 24 | + %tmp8 = load <3 x float>, <3 x float>* %g0, align 4, !alias.scope !0, !noalias !1 |
| 25 | + %tmp9 = extractelement <3 x float> %tmp8, i64 1 |
| 26 | + store float %tmp9, float* %tmp7, align 4, !alias.scope !1, !noalias !0 |
| 27 | + ret void; |
| 28 | +} |
| 29 | + |
| 30 | +; Ensure new scoped AA metadata are calculated after merging stores. |
| 31 | +define void @blam1(<3 x float>* %g0, <3 x float>* %g1) { |
| 32 | +; MIR-LABEL: name: blam1 |
| 33 | +; MIR: machineMetadataNodes: |
| 34 | +; MIR-DAG: ![[MMSET0:[0-9]+]] = !{![[SCOPE2]], ![[SCOPE1]]} |
| 35 | +; MIR-DAG: ![[MMSET1:[0-9]+]] = !{} |
| 36 | +; MIR: body: |
| 37 | +; MIR: LDRDui %0, 0 :: (load (s64) from %ir.g0, align 4, !alias.scope ![[SET0]], !noalias ![[SET1]]) |
| 38 | +; MIR: STRDui killed %5, %1, 0 :: (store (s64) into %ir.tmp41, align 4, !alias.scope ![[MMSET0]], !noalias ![[MMSET1]]) |
| 39 | + %tmp4 = getelementptr inbounds <3 x float>, <3 x float>* %g1, i64 0, i64 0 |
| 40 | + %tmp5 = load <3 x float>, <3 x float>* %g0, align 4, !alias.scope !0, !noalias !1 |
| 41 | + %tmp6 = extractelement <3 x float> %tmp5, i64 0 |
| 42 | + store float %tmp6, float* %tmp4, align 4, !alias.scope !1, !noalias !0 |
| 43 | + %tmp7 = getelementptr inbounds float, float* %tmp4, i64 1 |
| 44 | + %tmp8 = load <3 x float>, <3 x float>* %g0, align 4, !alias.scope !0, !noalias !1 |
| 45 | + %tmp9 = extractelement <3 x float> %tmp8, i64 1 |
| 46 | + store float %tmp9, float* %tmp7, align 4, !alias.scope !5, !noalias !6 |
| 47 | + ret void; |
| 48 | +} |
| 49 | + |
| 50 | +!0 = !{!2} |
| 51 | +!1 = !{!3} |
| 52 | +!2 = !{!2, !4, !"scope 0"} |
| 53 | +!3 = !{!3, !4, !"scope 1"} |
| 54 | +!4 = !{!4, !"domain"} |
| 55 | +!5 = !{!7} |
| 56 | +!6 = !{!8} |
| 57 | +!7 = !{!7, !4, !"scope 2"} |
| 58 | +!8 = !{!8, !4, !"scope 3"} |
0 commit comments