|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals none --version 6 |
| 2 | +; RUN: opt -p loop-vectorize -force-vector-width=2 -force-vector-interleave=1 -S %s | FileCheck --check-prefixes=VF2IC1 %s |
| 3 | +; RUN: opt -p loop-vectorize -force-vector-width=2 -force-vector-interleave=2 -S %s | FileCheck --check-prefixes=VF2IC2 %s |
| 4 | + |
| 5 | +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" |
| 6 | +target triple = "arm64-apple-macosx" |
| 7 | + |
| 8 | +define void @load_store_interleave_group_block_invar_cond(ptr noalias %data, ptr noalias %dst.0, ptr noalias %dst.1, i1 %c) { |
| 9 | +; VF2IC1-LABEL: define void @load_store_interleave_group_block_invar_cond( |
| 10 | +; VF2IC1-SAME: ptr noalias [[DATA:%.*]], ptr noalias [[DST_0:%.*]], ptr noalias [[DST_1:%.*]], i1 [[C:%.*]]) { |
| 11 | +; VF2IC1-NEXT: [[ENTRY:.*:]] |
| 12 | +; VF2IC1-NEXT: br label %[[VECTOR_PH:.*]] |
| 13 | +; VF2IC1: [[VECTOR_PH]]: |
| 14 | +; VF2IC1-NEXT: br label %[[VECTOR_BODY:.*]] |
| 15 | +; VF2IC1: [[VECTOR_BODY]]: |
| 16 | +; VF2IC1-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[PRED_STORE_CONTINUE2:.*]] ] |
| 17 | +; VF2IC1-NEXT: [[TMP0:%.*]] = shl nsw i64 [[INDEX]], 1 |
| 18 | +; VF2IC1-NEXT: [[TMP1:%.*]] = getelementptr inbounds i64, ptr [[DATA]], i64 [[TMP0]] |
| 19 | +; VF2IC1-NEXT: [[WIDE_LOAD:%.*]] = load <2 x i64>, ptr [[TMP1]], align 8 |
| 20 | +; VF2IC1-NEXT: store <2 x i64> [[WIDE_LOAD]], ptr [[TMP1]], align 8 |
| 21 | +; VF2IC1-NEXT: br i1 [[C]], label %[[PRED_STORE_IF:.*]], label %[[PRED_STORE_CONTINUE:.*]] |
| 22 | +; VF2IC1: [[PRED_STORE_IF]]: |
| 23 | +; VF2IC1-NEXT: store i8 1, ptr [[DST_0]], align 1 |
| 24 | +; VF2IC1-NEXT: br label %[[PRED_STORE_CONTINUE]] |
| 25 | +; VF2IC1: [[PRED_STORE_CONTINUE]]: |
| 26 | +; VF2IC1-NEXT: br i1 [[C]], label %[[PRED_STORE_IF1:.*]], label %[[PRED_STORE_CONTINUE2]] |
| 27 | +; VF2IC1: [[PRED_STORE_IF1]]: |
| 28 | +; VF2IC1-NEXT: store i8 1, ptr [[DST_0]], align 1 |
| 29 | +; VF2IC1-NEXT: br label %[[PRED_STORE_CONTINUE2]] |
| 30 | +; VF2IC1: [[PRED_STORE_CONTINUE2]]: |
| 31 | +; VF2IC1-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, ptr [[DST_1]], i64 [[INDEX]] |
| 32 | +; VF2IC1-NEXT: store <2 x i8> zeroinitializer, ptr [[TMP2]], align 1 |
| 33 | +; VF2IC1-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 1 |
| 34 | +; VF2IC1-NEXT: [[TMP3:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100 |
| 35 | +; VF2IC1-NEXT: br i1 [[TMP3]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]] |
| 36 | +; VF2IC1: [[MIDDLE_BLOCK]]: |
| 37 | +; VF2IC1-NEXT: br label %[[EXIT:.*]] |
| 38 | +; VF2IC1: [[EXIT]]: |
| 39 | +; VF2IC1-NEXT: ret void |
| 40 | +; |
| 41 | +; VF2IC2-LABEL: define void @load_store_interleave_group_block_invar_cond( |
| 42 | +; VF2IC2-SAME: ptr noalias [[DATA:%.*]], ptr noalias [[DST_0:%.*]], ptr noalias [[DST_1:%.*]], i1 [[C:%.*]]) { |
| 43 | +; VF2IC2-NEXT: [[ENTRY:.*:]] |
| 44 | +; VF2IC2-NEXT: br label %[[VECTOR_PH:.*]] |
| 45 | +; VF2IC2: [[VECTOR_PH]]: |
| 46 | +; VF2IC2-NEXT: br label %[[VECTOR_BODY:.*]] |
| 47 | +; VF2IC2: [[VECTOR_BODY]]: |
| 48 | +; VF2IC2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[PRED_STORE_CONTINUE7:.*]] ] |
| 49 | +; VF2IC2-NEXT: [[TMP0:%.*]] = add i64 [[INDEX]], 1 |
| 50 | +; VF2IC2-NEXT: [[TMP1:%.*]] = shl nsw i64 [[INDEX]], 1 |
| 51 | +; VF2IC2-NEXT: [[TMP2:%.*]] = shl nsw i64 [[TMP0]], 1 |
| 52 | +; VF2IC2-NEXT: [[TMP3:%.*]] = getelementptr inbounds i64, ptr [[DATA]], i64 [[TMP1]] |
| 53 | +; VF2IC2-NEXT: [[TMP4:%.*]] = getelementptr inbounds i64, ptr [[DATA]], i64 [[TMP2]] |
| 54 | +; VF2IC2-NEXT: [[WIDE_LOAD:%.*]] = load <2 x i64>, ptr [[TMP3]], align 8 |
| 55 | +; VF2IC2-NEXT: [[WIDE_LOAD1:%.*]] = load <2 x i64>, ptr [[TMP4]], align 8 |
| 56 | +; VF2IC2-NEXT: store <2 x i64> [[WIDE_LOAD]], ptr [[TMP3]], align 8 |
| 57 | +; VF2IC2-NEXT: store <2 x i64> [[WIDE_LOAD1]], ptr [[TMP4]], align 8 |
| 58 | +; VF2IC2-NEXT: br i1 [[C]], label %[[PRED_STORE_IF:.*]], label %[[PRED_STORE_CONTINUE:.*]] |
| 59 | +; VF2IC2: [[PRED_STORE_IF]]: |
| 60 | +; VF2IC2-NEXT: store i8 1, ptr [[DST_0]], align 1 |
| 61 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE]] |
| 62 | +; VF2IC2: [[PRED_STORE_CONTINUE]]: |
| 63 | +; VF2IC2-NEXT: br i1 [[C]], label %[[PRED_STORE_IF2:.*]], label %[[PRED_STORE_CONTINUE3:.*]] |
| 64 | +; VF2IC2: [[PRED_STORE_IF2]]: |
| 65 | +; VF2IC2-NEXT: store i8 1, ptr [[DST_0]], align 1 |
| 66 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE3]] |
| 67 | +; VF2IC2: [[PRED_STORE_CONTINUE3]]: |
| 68 | +; VF2IC2-NEXT: br i1 [[C]], label %[[PRED_STORE_IF4:.*]], label %[[PRED_STORE_CONTINUE5:.*]] |
| 69 | +; VF2IC2: [[PRED_STORE_IF4]]: |
| 70 | +; VF2IC2-NEXT: store i8 1, ptr [[DST_0]], align 1 |
| 71 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE5]] |
| 72 | +; VF2IC2: [[PRED_STORE_CONTINUE5]]: |
| 73 | +; VF2IC2-NEXT: br i1 [[C]], label %[[PRED_STORE_IF6:.*]], label %[[PRED_STORE_CONTINUE7]] |
| 74 | +; VF2IC2: [[PRED_STORE_IF6]]: |
| 75 | +; VF2IC2-NEXT: store i8 1, ptr [[DST_0]], align 1 |
| 76 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE7]] |
| 77 | +; VF2IC2: [[PRED_STORE_CONTINUE7]]: |
| 78 | +; VF2IC2-NEXT: [[TMP5:%.*]] = getelementptr inbounds i8, ptr [[DST_1]], i64 [[INDEX]] |
| 79 | +; VF2IC2-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr [[TMP5]], i32 2 |
| 80 | +; VF2IC2-NEXT: store <2 x i8> zeroinitializer, ptr [[TMP5]], align 1 |
| 81 | +; VF2IC2-NEXT: store <2 x i8> zeroinitializer, ptr [[TMP6]], align 1 |
| 82 | +; VF2IC2-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2 |
| 83 | +; VF2IC2-NEXT: [[TMP7:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100 |
| 84 | +; VF2IC2-NEXT: br i1 [[TMP7]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]] |
| 85 | +; VF2IC2: [[MIDDLE_BLOCK]]: |
| 86 | +; VF2IC2-NEXT: br label %[[EXIT:.*]] |
| 87 | +; VF2IC2: [[EXIT]]: |
| 88 | +; VF2IC2-NEXT: ret void |
| 89 | +; |
| 90 | +entry: |
| 91 | + br label %loop.header |
| 92 | + |
| 93 | +loop.header: |
| 94 | + %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ] |
| 95 | + %mul.2 = shl nsw i64 %iv, 1 |
| 96 | + %data.0 = getelementptr inbounds i64, ptr %data, i64 %mul.2 |
| 97 | + %l.0 = load i64, ptr %data.0, align 8 |
| 98 | + store i64 %l.0, ptr %data.0, align 8 |
| 99 | + %add.1 = or disjoint i64 %mul.2, 1 |
| 100 | + %data.1 = getelementptr inbounds i64, ptr %data, i64 %add.1 |
| 101 | + %l.1 = load i64, ptr %data.1, align 8 |
| 102 | + store i64 %l.1, ptr %data.1, align 8 |
| 103 | + br i1 %c, label %then, label %loop.latch |
| 104 | + |
| 105 | +then: |
| 106 | + store i8 1, ptr %dst.0 |
| 107 | + br label %loop.latch |
| 108 | + |
| 109 | +loop.latch: |
| 110 | + %gep.dst.1 = getelementptr inbounds i8, ptr %dst.1, i64 %iv |
| 111 | + store i8 0, ptr %gep.dst.1 |
| 112 | + %iv.next = add nuw nsw i64 %iv, 1 |
| 113 | + %ec = icmp eq i64 %iv.next, 100 |
| 114 | + br i1 %ec, label %exit, label %loop.header |
| 115 | + |
| 116 | +exit: |
| 117 | + ret void |
| 118 | +} |
| 119 | + |
| 120 | +define void @load_store_interleave_group_block_var_cond(ptr noalias %data, ptr %masks, ptr noalias %dst) { |
| 121 | +; VF2IC1-LABEL: define void @load_store_interleave_group_block_var_cond( |
| 122 | +; VF2IC1-SAME: ptr noalias [[DATA:%.*]], ptr [[MASKS:%.*]], ptr noalias [[DST:%.*]]) { |
| 123 | +; VF2IC1-NEXT: [[ENTRY:.*:]] |
| 124 | +; VF2IC1-NEXT: br label %[[VECTOR_PH:.*]] |
| 125 | +; VF2IC1: [[VECTOR_PH]]: |
| 126 | +; VF2IC1-NEXT: br label %[[VECTOR_BODY:.*]] |
| 127 | +; VF2IC1: [[VECTOR_BODY]]: |
| 128 | +; VF2IC1-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[PRED_STORE_CONTINUE3:.*]] ] |
| 129 | +; VF2IC1-NEXT: [[TMP0:%.*]] = shl nsw i64 [[INDEX]], 1 |
| 130 | +; VF2IC1-NEXT: [[TMP1:%.*]] = getelementptr inbounds i64, ptr [[DATA]], i64 [[TMP0]] |
| 131 | +; VF2IC1-NEXT: [[WIDE_LOAD:%.*]] = load <2 x i64>, ptr [[TMP1]], align 8 |
| 132 | +; VF2IC1-NEXT: store <2 x i64> [[WIDE_LOAD]], ptr [[TMP1]], align 8 |
| 133 | +; VF2IC1-NEXT: [[TMP2:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[INDEX]] |
| 134 | +; VF2IC1-NEXT: [[WIDE_LOAD1:%.*]] = load <2 x i8>, ptr [[TMP2]], align 1 |
| 135 | +; VF2IC1-NEXT: [[TMP3:%.*]] = icmp eq <2 x i8> [[WIDE_LOAD1]], zeroinitializer |
| 136 | +; VF2IC1-NEXT: [[TMP4:%.*]] = extractelement <2 x i1> [[TMP3]], i32 0 |
| 137 | +; VF2IC1-NEXT: br i1 [[TMP4]], label %[[PRED_STORE_IF:.*]], label %[[PRED_STORE_CONTINUE:.*]] |
| 138 | +; VF2IC1: [[PRED_STORE_IF]]: |
| 139 | +; VF2IC1-NEXT: [[TMP5:%.*]] = add i64 [[INDEX]], 0 |
| 140 | +; VF2IC1-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[TMP5]] |
| 141 | +; VF2IC1-NEXT: store i8 1, ptr [[TMP6]], align 1 |
| 142 | +; VF2IC1-NEXT: br label %[[PRED_STORE_CONTINUE]] |
| 143 | +; VF2IC1: [[PRED_STORE_CONTINUE]]: |
| 144 | +; VF2IC1-NEXT: [[TMP7:%.*]] = extractelement <2 x i1> [[TMP3]], i32 1 |
| 145 | +; VF2IC1-NEXT: br i1 [[TMP7]], label %[[PRED_STORE_IF2:.*]], label %[[PRED_STORE_CONTINUE3]] |
| 146 | +; VF2IC1: [[PRED_STORE_IF2]]: |
| 147 | +; VF2IC1-NEXT: [[TMP8:%.*]] = add i64 [[INDEX]], 1 |
| 148 | +; VF2IC1-NEXT: [[TMP9:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[TMP8]] |
| 149 | +; VF2IC1-NEXT: store i8 1, ptr [[TMP9]], align 1 |
| 150 | +; VF2IC1-NEXT: br label %[[PRED_STORE_CONTINUE3]] |
| 151 | +; VF2IC1: [[PRED_STORE_CONTINUE3]]: |
| 152 | +; VF2IC1-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 1 |
| 153 | +; VF2IC1-NEXT: [[TMP10:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100 |
| 154 | +; VF2IC1-NEXT: br i1 [[TMP10]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP3:![0-9]+]] |
| 155 | +; VF2IC1: [[MIDDLE_BLOCK]]: |
| 156 | +; VF2IC1-NEXT: br label %[[EXIT:.*]] |
| 157 | +; VF2IC1: [[EXIT]]: |
| 158 | +; VF2IC1-NEXT: ret void |
| 159 | +; |
| 160 | +; VF2IC2-LABEL: define void @load_store_interleave_group_block_var_cond( |
| 161 | +; VF2IC2-SAME: ptr noalias [[DATA:%.*]], ptr [[MASKS:%.*]], ptr noalias [[DST:%.*]]) { |
| 162 | +; VF2IC2-NEXT: [[ENTRY:.*:]] |
| 163 | +; VF2IC2-NEXT: br label %[[VECTOR_PH:.*]] |
| 164 | +; VF2IC2: [[VECTOR_PH]]: |
| 165 | +; VF2IC2-NEXT: br label %[[VECTOR_BODY:.*]] |
| 166 | +; VF2IC2: [[VECTOR_BODY]]: |
| 167 | +; VF2IC2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[PRED_STORE_CONTINUE12:.*]] ] |
| 168 | +; VF2IC2-NEXT: [[TMP0:%.*]] = add i64 [[INDEX]], 2 |
| 169 | +; VF2IC2-NEXT: [[TMP1:%.*]] = shl nsw i64 [[INDEX]], 1 |
| 170 | +; VF2IC2-NEXT: [[TMP2:%.*]] = shl nsw i64 [[TMP0]], 1 |
| 171 | +; VF2IC2-NEXT: [[TMP3:%.*]] = getelementptr inbounds i64, ptr [[DATA]], i64 [[TMP1]] |
| 172 | +; VF2IC2-NEXT: [[TMP4:%.*]] = getelementptr inbounds i64, ptr [[DATA]], i64 [[TMP2]] |
| 173 | +; VF2IC2-NEXT: [[WIDE_VEC:%.*]] = load <4 x i64>, ptr [[TMP3]], align 8 |
| 174 | +; VF2IC2-NEXT: [[STRIDED_VEC:%.*]] = shufflevector <4 x i64> [[WIDE_VEC]], <4 x i64> poison, <2 x i32> <i32 0, i32 2> |
| 175 | +; VF2IC2-NEXT: [[STRIDED_VEC1:%.*]] = shufflevector <4 x i64> [[WIDE_VEC]], <4 x i64> poison, <2 x i32> <i32 1, i32 3> |
| 176 | +; VF2IC2-NEXT: [[WIDE_VEC2:%.*]] = load <4 x i64>, ptr [[TMP4]], align 8 |
| 177 | +; VF2IC2-NEXT: [[STRIDED_VEC3:%.*]] = shufflevector <4 x i64> [[WIDE_VEC2]], <4 x i64> poison, <2 x i32> <i32 0, i32 2> |
| 178 | +; VF2IC2-NEXT: [[STRIDED_VEC4:%.*]] = shufflevector <4 x i64> [[WIDE_VEC2]], <4 x i64> poison, <2 x i32> <i32 1, i32 3> |
| 179 | +; VF2IC2-NEXT: [[TMP5:%.*]] = shufflevector <2 x i64> [[STRIDED_VEC]], <2 x i64> [[STRIDED_VEC1]], <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
| 180 | +; VF2IC2-NEXT: [[INTERLEAVED_VEC:%.*]] = shufflevector <4 x i64> [[TMP5]], <4 x i64> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3> |
| 181 | +; VF2IC2-NEXT: store <4 x i64> [[INTERLEAVED_VEC]], ptr [[TMP3]], align 8 |
| 182 | +; VF2IC2-NEXT: [[TMP6:%.*]] = shufflevector <2 x i64> [[STRIDED_VEC3]], <2 x i64> [[STRIDED_VEC4]], <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
| 183 | +; VF2IC2-NEXT: [[INTERLEAVED_VEC5:%.*]] = shufflevector <4 x i64> [[TMP6]], <4 x i64> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3> |
| 184 | +; VF2IC2-NEXT: store <4 x i64> [[INTERLEAVED_VEC5]], ptr [[TMP4]], align 8 |
| 185 | +; VF2IC2-NEXT: [[TMP7:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[INDEX]] |
| 186 | +; VF2IC2-NEXT: [[TMP8:%.*]] = getelementptr inbounds i8, ptr [[TMP7]], i32 2 |
| 187 | +; VF2IC2-NEXT: [[WIDE_LOAD:%.*]] = load <2 x i8>, ptr [[TMP7]], align 1 |
| 188 | +; VF2IC2-NEXT: [[WIDE_LOAD6:%.*]] = load <2 x i8>, ptr [[TMP8]], align 1 |
| 189 | +; VF2IC2-NEXT: [[TMP9:%.*]] = icmp eq <2 x i8> [[WIDE_LOAD]], zeroinitializer |
| 190 | +; VF2IC2-NEXT: [[TMP10:%.*]] = icmp eq <2 x i8> [[WIDE_LOAD6]], zeroinitializer |
| 191 | +; VF2IC2-NEXT: [[TMP11:%.*]] = extractelement <2 x i1> [[TMP9]], i32 0 |
| 192 | +; VF2IC2-NEXT: br i1 [[TMP11]], label %[[PRED_STORE_IF:.*]], label %[[PRED_STORE_CONTINUE:.*]] |
| 193 | +; VF2IC2: [[PRED_STORE_IF]]: |
| 194 | +; VF2IC2-NEXT: [[TMP12:%.*]] = add i64 [[INDEX]], 0 |
| 195 | +; VF2IC2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[TMP12]] |
| 196 | +; VF2IC2-NEXT: store i8 1, ptr [[TMP13]], align 1 |
| 197 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE]] |
| 198 | +; VF2IC2: [[PRED_STORE_CONTINUE]]: |
| 199 | +; VF2IC2-NEXT: [[TMP14:%.*]] = extractelement <2 x i1> [[TMP9]], i32 1 |
| 200 | +; VF2IC2-NEXT: br i1 [[TMP14]], label %[[PRED_STORE_IF7:.*]], label %[[PRED_STORE_CONTINUE8:.*]] |
| 201 | +; VF2IC2: [[PRED_STORE_IF7]]: |
| 202 | +; VF2IC2-NEXT: [[TMP15:%.*]] = add i64 [[INDEX]], 1 |
| 203 | +; VF2IC2-NEXT: [[TMP16:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[TMP15]] |
| 204 | +; VF2IC2-NEXT: store i8 1, ptr [[TMP16]], align 1 |
| 205 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE8]] |
| 206 | +; VF2IC2: [[PRED_STORE_CONTINUE8]]: |
| 207 | +; VF2IC2-NEXT: [[TMP17:%.*]] = extractelement <2 x i1> [[TMP10]], i32 0 |
| 208 | +; VF2IC2-NEXT: br i1 [[TMP17]], label %[[PRED_STORE_IF9:.*]], label %[[PRED_STORE_CONTINUE10:.*]] |
| 209 | +; VF2IC2: [[PRED_STORE_IF9]]: |
| 210 | +; VF2IC2-NEXT: [[TMP18:%.*]] = add i64 [[INDEX]], 2 |
| 211 | +; VF2IC2-NEXT: [[TMP19:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[TMP18]] |
| 212 | +; VF2IC2-NEXT: store i8 1, ptr [[TMP19]], align 1 |
| 213 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE10]] |
| 214 | +; VF2IC2: [[PRED_STORE_CONTINUE10]]: |
| 215 | +; VF2IC2-NEXT: [[TMP20:%.*]] = extractelement <2 x i1> [[TMP10]], i32 1 |
| 216 | +; VF2IC2-NEXT: br i1 [[TMP20]], label %[[PRED_STORE_IF11:.*]], label %[[PRED_STORE_CONTINUE12]] |
| 217 | +; VF2IC2: [[PRED_STORE_IF11]]: |
| 218 | +; VF2IC2-NEXT: [[TMP21:%.*]] = add i64 [[INDEX]], 3 |
| 219 | +; VF2IC2-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, ptr [[MASKS]], i64 [[TMP21]] |
| 220 | +; VF2IC2-NEXT: store i8 1, ptr [[TMP22]], align 1 |
| 221 | +; VF2IC2-NEXT: br label %[[PRED_STORE_CONTINUE12]] |
| 222 | +; VF2IC2: [[PRED_STORE_CONTINUE12]]: |
| 223 | +; VF2IC2-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4 |
| 224 | +; VF2IC2-NEXT: [[TMP23:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100 |
| 225 | +; VF2IC2-NEXT: br i1 [[TMP23]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP3:![0-9]+]] |
| 226 | +; VF2IC2: [[MIDDLE_BLOCK]]: |
| 227 | +; VF2IC2-NEXT: br label %[[EXIT:.*]] |
| 228 | +; VF2IC2: [[EXIT]]: |
| 229 | +; VF2IC2-NEXT: ret void |
| 230 | +; |
| 231 | +entry: |
| 232 | + br label %loop.header |
| 233 | + |
| 234 | +loop.header: |
| 235 | + %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ] |
| 236 | + %mul.2 = shl nsw i64 %iv, 1 |
| 237 | + %data.0 = getelementptr inbounds i64, ptr %data, i64 %mul.2 |
| 238 | + %l.0 = load i64, ptr %data.0, align 8 |
| 239 | + store i64 %l.0, ptr %data.0, align 8 |
| 240 | + %add.1 = or disjoint i64 %mul.2, 1 |
| 241 | + %data.1 = getelementptr inbounds i64, ptr %data, i64 %add.1 |
| 242 | + %l.1 = load i64, ptr %data.1, align 8 |
| 243 | + store i64 %l.1, ptr %data.1, align 8 |
| 244 | + %gep.mask = getelementptr inbounds i8, ptr %masks, i64 %iv |
| 245 | + %l.mask = load i8, ptr %gep.mask |
| 246 | + %c = icmp eq i8 %l.mask, 0 |
| 247 | + br i1 %c, label %then, label %loop.latch |
| 248 | + |
| 249 | +then: |
| 250 | + store i8 1, ptr %gep.mask |
| 251 | + br label %loop.latch |
| 252 | + |
| 253 | +loop.latch: |
| 254 | + %iv.next = add nuw nsw i64 %iv, 1 |
| 255 | + %ec = icmp eq i64 %iv.next, 100 |
| 256 | + br i1 %ec, label %exit, label %loop.header |
| 257 | + |
| 258 | +exit: |
| 259 | + ret void |
| 260 | +} |
0 commit comments