brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.3 KiB · b8dd3c1 Raw
121 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx  | FileCheck %s --check-prefixes=ALL,AVX3; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=ALL,AVX24 5; https://bugs.llvm.org/show_bug.cgi?id=516156; We can not replace a wide volatile load with a broadcast-from-memory,7; because that would narrow the load, which isn't legal for volatiles.8 9@g0 = external dso_local global <2 x double>, align 1610define void @volatile_load_2_elts() {11; AVX-LABEL: volatile_load_2_elts:12; AVX:       # %bb.0:13; AVX-NEXT:    vmovaps g0(%rip), %xmm014; AVX-NEXT:    vmovddup {{.*#+}} xmm1 = xmm0[0,0]15; AVX-NEXT:    vinsertf128 $1, %xmm1, %ymm1, %ymm116; AVX-NEXT:    vxorps %xmm2, %xmm2, %xmm217; AVX-NEXT:    vblendps {{.*#+}} ymm1 = ymm2[0,1],ymm1[2,3],ymm2[4,5],ymm1[6,7]18; AVX-NEXT:    vperm2f128 {{.*#+}} ymm0 = zero,zero,ymm0[0,1]19; AVX-NEXT:    vblendps {{.*#+}} ymm0 = ymm2[0,1,2,3],ymm0[4,5],ymm2[6,7]20; AVX-NEXT:    vmovaps %ymm0, (%rax)21; AVX-NEXT:    vmovaps %ymm1, (%rax)22; AVX-NEXT:    vzeroupper23; AVX-NEXT:    retq24;25; AVX2-LABEL: volatile_load_2_elts:26; AVX2:       # %bb.0:27; AVX2-NEXT:    vmovaps g0(%rip), %xmm028; AVX2-NEXT:    vbroadcastsd %xmm0, %ymm029; AVX2-NEXT:    vxorps %xmm1, %xmm1, %xmm130; AVX2-NEXT:    vblendps {{.*#+}} ymm2 = ymm1[0,1,2,3],ymm0[4,5],ymm1[6,7]31; AVX2-NEXT:    vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]32; AVX2-NEXT:    vmovaps %ymm0, (%rax)33; AVX2-NEXT:    vmovaps %ymm2, (%rax)34; AVX2-NEXT:    vzeroupper35; AVX2-NEXT:    retq36  %i = load volatile <2 x double>, ptr @g0, align 1637  %i1 = shufflevector <2 x double> %i, <2 x double> poison, <4 x i32> <i32 undef, i32 0, i32 undef, i32 0>38  %shuffle1 = shufflevector <4 x double> %i1, <4 x double> zeroinitializer, <8 x i32> <i32 6, i32 7, i32 3, i32 6, i32 7, i32 1, i32 7, i32 1>39  store volatile <8 x double> %shuffle1, ptr undef, align 6440  ret void41}42 43@g1 = external dso_local global <1 x double>, align 1644define void @volatile_load_1_elt() {45; ALL-LABEL: volatile_load_1_elt:46; ALL:       # %bb.0:47; ALL-NEXT:    vbroadcastsd g1(%rip), %ymm048; ALL-NEXT:    vxorps %xmm1, %xmm1, %xmm149; ALL-NEXT:    vblendps {{.*#+}} ymm2 = ymm1[0,1,2,3],ymm0[4,5],ymm1[6,7]50; ALL-NEXT:    vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]51; ALL-NEXT:    vmovaps %ymm0, (%rax)52; ALL-NEXT:    vmovaps %ymm2, (%rax)53; ALL-NEXT:    vzeroupper54; ALL-NEXT:    retq55  %i = load volatile <1 x double>, ptr @g1, align 1656  %i1 = shufflevector <1 x double> %i, <1 x double> poison, <4 x i32> <i32 undef, i32 0, i32 undef, i32 0>57  %shuffle1 = shufflevector <4 x double> %i1, <4 x double> zeroinitializer, <8 x i32> <i32 6, i32 7, i32 3, i32 6, i32 7, i32 1, i32 7, i32 1>58  store volatile <8 x double> %shuffle1, ptr undef, align 6459  ret void60}61 62@g2 = external dso_local global <2 x float>, align 1663define void @volatile_load_2_elts_bitcast() {64; ALL-LABEL: volatile_load_2_elts_bitcast:65; ALL:       # %bb.0:66; ALL-NEXT:    vbroadcastsd g2(%rip), %ymm067; ALL-NEXT:    vxorps %xmm1, %xmm1, %xmm168; ALL-NEXT:    vblendps {{.*#+}} ymm2 = ymm1[0,1,2,3],ymm0[4,5],ymm1[6,7]69; ALL-NEXT:    vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]70; ALL-NEXT:    vmovaps %ymm0, (%rax)71; ALL-NEXT:    vmovaps %ymm2, (%rax)72; ALL-NEXT:    vzeroupper73; ALL-NEXT:    retq74  %i0 = load volatile <2 x float>, ptr @g2, align 1675  %i = bitcast <2 x float> %i0 to <1 x double>76  %i1 = shufflevector <1 x double> %i, <1 x double> poison, <4 x i32> <i32 undef, i32 0, i32 undef, i32 0>77  %shuffle1 = shufflevector <4 x double> %i1, <4 x double> zeroinitializer, <8 x i32> <i32 6, i32 7, i32 3, i32 6, i32 7, i32 1, i32 7, i32 1>78  store volatile <8 x double> %shuffle1, ptr undef, align 6479  ret void80}81 82define void @elts_from_consecutive_loads(ptr %arg, ptr %arg12, ptr %arg13, float %arg14, i1 %arg15) {83; ALL-LABEL: elts_from_consecutive_loads:84; ALL:       # %bb.0: # %bb85; ALL-NEXT:    vxorps %xmm1, %xmm1, %xmm186; ALL-NEXT:    .p2align 487; ALL-NEXT:  .LBB3_1: # %bb1688; ALL-NEXT:    # =>This Loop Header: Depth=189; ALL-NEXT:    # Child Loop BB3_2 Depth 290; ALL-NEXT:    testb $1, %cl91; ALL-NEXT:    je .LBB3_192; ALL-NEXT:    .p2align 493; ALL-NEXT:  .LBB3_2: # %bb1794; ALL-NEXT:    # Parent Loop BB3_1 Depth=195; ALL-NEXT:    # => This Inner Loop Header: Depth=296; ALL-NEXT:    movl (%rdi), %eax97; ALL-NEXT:    vbroadcastss (%rdi), %ymm298; ALL-NEXT:    movl %eax, (%rsi)99; ALL-NEXT:    vmovaps %ymm2, (%rdx)100; ALL-NEXT:    vucomiss %xmm1, %xmm0101; ALL-NEXT:    jne .LBB3_2102; ALL-NEXT:    jp .LBB3_2103; ALL-NEXT:    jmp .LBB3_1104bb:105  br label %bb16106 107bb16:                                             ; preds = %bb17, %bb16, %bb108  br i1 %arg15, label %bb17, label %bb16109 110bb17:                                             ; preds = %bb17, %bb16111  %tmp = load <2 x i64>, ptr %arg, align 16112  %tmp18 = extractelement <2 x i64> %tmp, i32 0113  %tmp19 = trunc i64 %tmp18 to i32114  store i32 %tmp19, ptr %arg12, align 4115  %tmp20 = insertelement <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>, i32 %tmp19, i32 0116  %tmp21 = shufflevector <8 x i32> %tmp20, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>, <8 x i32> <i32 0, i32 undef, i32 undef, i32 undef, i32 0, i32 undef, i32 undef, i32 undef>117  store <8 x i32> %tmp21, ptr %arg13, align 32118  %tmp22 = fcmp une float %arg14, 0.000000e+00119  br i1 %tmp22, label %bb17, label %bb16120}121