143 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt < %s -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -passes=slp-vectorizer -S | FileCheck %s --check-prefix=GFX93 4define protected amdgpu_kernel void @myfun(i32 %in, ptr addrspace(1) %aptr1, ptr addrspace(1) %bptr1, ptr addrspace(1) %aptr2, ptr addrspace(1) %bptr2) {5; GFX9-LABEL: define protected amdgpu_kernel void @myfun(6; GFX9-SAME: i32 [[IN:%.*]], ptr addrspace(1) [[APTR1:%.*]], ptr addrspace(1) [[BPTR1:%.*]], ptr addrspace(1) [[APTR2:%.*]], ptr addrspace(1) [[BPTR2:%.*]]) #[[ATTR0:[0-9]+]] {7; GFX9-NEXT: [[ENTRY:.*]]:8; GFX9-NEXT: [[VEC1:%.*]] = load <8 x i16>, ptr addrspace(1) [[APTR1]], align 169; GFX9-NEXT: [[BVEC1:%.*]] = load <8 x i16>, ptr addrspace(1) [[BPTR1]], align 1610; GFX9-NEXT: [[TMP0:%.*]] = shufflevector <8 x i16> [[VEC1]], <8 x i16> poison, <2 x i32> <i32 0, i32 1>11; GFX9-NEXT: [[TMP1:%.*]] = shufflevector <8 x i16> [[VEC1]], <8 x i16> poison, <2 x i32> <i32 2, i32 3>12; GFX9-NEXT: [[TMP2:%.*]] = shufflevector <8 x i16> [[VEC1]], <8 x i16> poison, <2 x i32> <i32 4, i32 5>13; GFX9-NEXT: [[TMP3:%.*]] = shufflevector <8 x i16> [[VEC1]], <8 x i16> poison, <2 x i32> <i32 6, i32 7>14; GFX9-NEXT: [[TMP4:%.*]] = shufflevector <8 x i16> [[BVEC1]], <8 x i16> poison, <2 x i32> <i32 0, i32 1>15; GFX9-NEXT: [[TMP5:%.*]] = shufflevector <8 x i16> [[BVEC1]], <8 x i16> poison, <2 x i32> <i32 2, i32 3>16; GFX9-NEXT: [[TMP6:%.*]] = shufflevector <8 x i16> [[BVEC1]], <8 x i16> poison, <2 x i32> <i32 4, i32 5>17; GFX9-NEXT: [[TMP7:%.*]] = shufflevector <8 x i16> [[BVEC1]], <8 x i16> poison, <2 x i32> <i32 6, i32 7>18; GFX9-NEXT: br label %[[DO_BODY:.*]]19; GFX9: [[DO_BODY]]:20; GFX9-NEXT: [[ADD:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[NEWADD:%.*]], %[[DO_BODY]] ]21; GFX9-NEXT: [[TMP8:%.*]] = phi <2 x i16> [ [[TMP0]], %[[ENTRY]] ], [ [[TMP30:%.*]], %[[DO_BODY]] ]22; GFX9-NEXT: [[TMP9:%.*]] = phi <2 x i16> [ [[TMP1]], %[[ENTRY]] ], [ [[TMP31:%.*]], %[[DO_BODY]] ]23; GFX9-NEXT: [[TMP10:%.*]] = phi <2 x i16> [ [[TMP2]], %[[ENTRY]] ], [ [[TMP32:%.*]], %[[DO_BODY]] ]24; GFX9-NEXT: [[TMP11:%.*]] = phi <2 x i16> [ [[TMP3]], %[[ENTRY]] ], [ [[TMP33:%.*]], %[[DO_BODY]] ]25; GFX9-NEXT: [[TMP12:%.*]] = phi <2 x i16> [ [[TMP4]], %[[ENTRY]] ], [ [[TMP34:%.*]], %[[DO_BODY]] ]26; GFX9-NEXT: [[TMP13:%.*]] = phi <2 x i16> [ [[TMP5]], %[[ENTRY]] ], [ [[TMP35:%.*]], %[[DO_BODY]] ]27; GFX9-NEXT: [[TMP14:%.*]] = phi <2 x i16> [ [[TMP6]], %[[ENTRY]] ], [ [[TMP36:%.*]], %[[DO_BODY]] ]28; GFX9-NEXT: [[TMP15:%.*]] = phi <2 x i16> [ [[TMP7]], %[[ENTRY]] ], [ [[TMP37:%.*]], %[[DO_BODY]] ]29; GFX9-NEXT: [[TMP16:%.*]] = shufflevector <2 x i16> [[TMP8]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>30; GFX9-NEXT: [[TMP17:%.*]] = shufflevector <2 x i16> [[TMP9]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>31; GFX9-NEXT: [[TMP18:%.*]] = shufflevector <2 x i16> [[TMP8]], <2 x i16> [[TMP9]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>32; GFX9-NEXT: [[TMP19:%.*]] = shufflevector <2 x i16> [[TMP10]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>33; GFX9-NEXT: [[TMP20:%.*]] = shufflevector <8 x i16> [[TMP18]], <8 x i16> [[TMP19]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 poison, i32 poison>34; GFX9-NEXT: [[TMP21:%.*]] = shufflevector <2 x i16> [[TMP11]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>35; GFX9-NEXT: [[TMP22:%.*]] = shufflevector <8 x i16> [[TMP20]], <8 x i16> [[TMP21]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9>36; GFX9-NEXT: [[TMP23:%.*]] = shufflevector <2 x i16> [[TMP12]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>37; GFX9-NEXT: [[TMP24:%.*]] = shufflevector <2 x i16> [[TMP13]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>38; GFX9-NEXT: [[TMP25:%.*]] = shufflevector <2 x i16> [[TMP12]], <2 x i16> [[TMP13]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>39; GFX9-NEXT: [[TMP26:%.*]] = shufflevector <2 x i16> [[TMP14]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>40; GFX9-NEXT: [[TMP27:%.*]] = shufflevector <8 x i16> [[TMP25]], <8 x i16> [[TMP26]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 poison, i32 poison>41; GFX9-NEXT: [[TMP28:%.*]] = shufflevector <2 x i16> [[TMP15]], <2 x i16> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>42; GFX9-NEXT: [[TMP29:%.*]] = shufflevector <8 x i16> [[TMP27]], <8 x i16> [[TMP28]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9>43; GFX9-NEXT: [[RES:%.*]] = add <8 x i16> [[TMP22]], [[TMP29]]44; GFX9-NEXT: [[VEC2:%.*]] = load <8 x i16>, ptr addrspace(1) [[APTR2]], align 1645; GFX9-NEXT: [[BVEC2:%.*]] = load <8 x i16>, ptr addrspace(1) [[BPTR2]], align 1646; GFX9-NEXT: [[NEWADD]] = add i32 [[ADD]], 147; GFX9-NEXT: [[COND:%.*]] = icmp sgt i32 [[NEWADD]], [[IN]]48; GFX9-NEXT: [[TMP30]] = shufflevector <8 x i16> [[VEC2]], <8 x i16> poison, <2 x i32> <i32 0, i32 1>49; GFX9-NEXT: [[TMP31]] = shufflevector <8 x i16> [[VEC2]], <8 x i16> poison, <2 x i32> <i32 2, i32 3>50; GFX9-NEXT: [[TMP32]] = shufflevector <8 x i16> [[VEC2]], <8 x i16> poison, <2 x i32> <i32 4, i32 5>51; GFX9-NEXT: [[TMP33]] = shufflevector <8 x i16> [[VEC2]], <8 x i16> poison, <2 x i32> <i32 6, i32 7>52; GFX9-NEXT: [[TMP34]] = shufflevector <8 x i16> [[BVEC2]], <8 x i16> poison, <2 x i32> <i32 0, i32 1>53; GFX9-NEXT: [[TMP35]] = shufflevector <8 x i16> [[BVEC2]], <8 x i16> poison, <2 x i32> <i32 2, i32 3>54; GFX9-NEXT: [[TMP36]] = shufflevector <8 x i16> [[BVEC2]], <8 x i16> poison, <2 x i32> <i32 4, i32 5>55; GFX9-NEXT: [[TMP37]] = shufflevector <8 x i16> [[BVEC2]], <8 x i16> poison, <2 x i32> <i32 6, i32 7>56; GFX9-NEXT: br i1 [[COND]], label %[[DO_BODY]], label %[[END:.*]]57; GFX9: [[END]]:58; GFX9-NEXT: ret void59;60entry:61 %vec1 = load <8 x i16>, ptr addrspace(1) %aptr162 %el0 = extractelement <8 x i16> %vec1, i64 063 %el1 = extractelement <8 x i16> %vec1, i64 164 %el2 = extractelement <8 x i16> %vec1, i64 265 %el3 = extractelement <8 x i16> %vec1, i64 366 %el4 = extractelement <8 x i16> %vec1, i64 467 %el5 = extractelement <8 x i16> %vec1, i64 568 %el6 = extractelement <8 x i16> %vec1, i64 669 %el7 = extractelement <8 x i16> %vec1, i64 770 %bvec1 = load <8 x i16>, ptr addrspace(1) %bptr171 %bel0 = extractelement <8 x i16> %bvec1, i64 072 %bel1 = extractelement <8 x i16> %bvec1, i64 173 %bel2 = extractelement <8 x i16> %bvec1, i64 274 %bel3 = extractelement <8 x i16> %bvec1, i64 375 %bel4 = extractelement <8 x i16> %bvec1, i64 476 %bel5 = extractelement <8 x i16> %bvec1, i64 577 %bel6 = extractelement <8 x i16> %bvec1, i64 678 %bel7 = extractelement <8 x i16> %bvec1, i64 779 br label %do.body80 81do.body:82 %a_thread_buf1 = phi i16 [%el1, %entry], [%newel1, %do.body]83 %a_thread_buf2 = phi i16 [%el2, %entry], [%newel2, %do.body]84 %a_thread_buf3 = phi i16 [%el3, %entry], [%newel3, %do.body]85 %a_thread_buf4 = phi i16 [%el4, %entry], [%newel4, %do.body]86 %a_thread_buf5 = phi i16 [%el5, %entry], [%newel5, %do.body]87 %a_thread_buf6 = phi i16 [%el6, %entry], [%newel6, %do.body]88 %a_thread_buf7 = phi i16 [%el7, %entry], [%newel7, %do.body]89 %b_thread_buf1 = phi i16 [%bel1, %entry], [%bnewel1, %do.body]90 %b_thread_buf2 = phi i16 [%bel2, %entry], [%bnewel2, %do.body]91 %b_thread_buf3 = phi i16 [%bel3, %entry], [%bnewel3, %do.body]92 %b_thread_buf4 = phi i16 [%bel4, %entry], [%bnewel4, %do.body]93 %b_thread_buf5 = phi i16 [%bel5, %entry], [%bnewel5, %do.body]94 %b_thread_buf6 = phi i16 [%bel6, %entry], [%bnewel6, %do.body]95 %b_thread_buf7 = phi i16 [%bel7, %entry], [%bnewel7, %do.body]96 %add = phi i32 [0, %entry], [%newadd, %do.body]97 %a_thread_buf0 = phi i16 [%el0, %entry], [%newel0, %do.body]98 %b_thread_buf0 = phi i16 [%bel0, %entry], [%bnewel0, %do.body]99 %a_thread_vec0 = insertelement <8 x i16> poison, i16 %a_thread_buf0, i64 0100 %a_thread_vec1 = insertelement <8 x i16> %a_thread_vec0, i16 %a_thread_buf1, i64 1101 %a_thread_vec2 = insertelement <8 x i16> %a_thread_vec1, i16 %a_thread_buf2, i64 2102 %a_thread_vec3 = insertelement <8 x i16> %a_thread_vec2, i16 %a_thread_buf3, i64 3103 %a_thread_vec4 = insertelement <8 x i16> %a_thread_vec3, i16 %a_thread_buf4, i64 4104 %a_thread_vec5 = insertelement <8 x i16> %a_thread_vec4, i16 %a_thread_buf5, i64 5105 %a_thread_vec6 = insertelement <8 x i16> %a_thread_vec5, i16 %a_thread_buf6, i64 6106 %a_thread_vec7 = insertelement <8 x i16> %a_thread_vec6, i16 %a_thread_buf7, i64 7107 %b_thread_vec0 = insertelement <8 x i16> poison, i16 %b_thread_buf0, i64 0108 %b_thread_vec1 = insertelement <8 x i16> %b_thread_vec0, i16 %b_thread_buf1, i64 1109 %b_thread_vec2 = insertelement <8 x i16> %b_thread_vec1, i16 %b_thread_buf2, i64 2110 %b_thread_vec3 = insertelement <8 x i16> %b_thread_vec2, i16 %b_thread_buf3, i64 3111 %b_thread_vec4 = insertelement <8 x i16> %b_thread_vec3, i16 %b_thread_buf4, i64 4112 %b_thread_vec5 = insertelement <8 x i16> %b_thread_vec4, i16 %b_thread_buf5, i64 5113 %b_thread_vec6 = insertelement <8 x i16> %b_thread_vec5, i16 %b_thread_buf6, i64 6114 %b_thread_vec7 = insertelement <8 x i16> %b_thread_vec6, i16 %b_thread_buf7, i64 7115 %res = add <8 x i16> %a_thread_vec7, %b_thread_vec7116 %vec2 = load <8 x i16>, ptr addrspace(1) %aptr2117 %newel0 = extractelement <8 x i16> %vec2, i64 0118 %newel1 = extractelement <8 x i16> %vec2, i64 1119 %newel2 = extractelement <8 x i16> %vec2, i64 2120 %newel3 = extractelement <8 x i16> %vec2, i64 3121 %newel4 = extractelement <8 x i16> %vec2, i64 4122 %newel5 = extractelement <8 x i16> %vec2, i64 5123 %newel6 = extractelement <8 x i16> %vec2, i64 6124 %newel7 = extractelement <8 x i16> %vec2, i64 7125 %bvec2 = load <8 x i16>, ptr addrspace(1) %bptr2126 %bnewel0 = extractelement <8 x i16> %bvec2, i64 0127 %bnewel1 = extractelement <8 x i16> %bvec2, i64 1128 %bnewel2 = extractelement <8 x i16> %bvec2, i64 2129 %bnewel3 = extractelement <8 x i16> %bvec2, i64 3130 %bnewel4 = extractelement <8 x i16> %bvec2, i64 4131 %bnewel5 = extractelement <8 x i16> %bvec2, i64 5132 %bnewel6 = extractelement <8 x i16> %bvec2, i64 6133 %bnewel7 = extractelement <8 x i16> %bvec2, i64 7134 %newadd = add i32 %add, 1135 %cond = icmp sgt i32 %newadd, %in136 br i1 %cond, label %do.body, label %end137 138end:139 ret void140}141 142 143