65 lines · plain
1; RUN: opt < %s -force-vector-width=4 -force-vector-interleave=2 -passes=loop-vectorize,instcombine -S | FileCheck %s2; RUN: opt < %s -force-vector-width=4 -force-vector-interleave=2 -passes=loop-vectorize -S | FileCheck %s --check-prefix=NO-IC3 4target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"5 6; CHECK-LABEL: @scalar_after_vectorization_07;8; CHECK: vector.body:9; CHECK: %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]10; CHECK: [[OFFSET_IDX:%.+]] = or disjoint i64 %index, 111; CHECK: %[[T2:.+]] = add nuw nsw i64 [[OFFSET_IDX]], %tmp012; CHECK: %[[T3:.+]] = sub nsw i64 %[[T2]], %x13; CHECK: %[[T4:.+]] = getelementptr inbounds i32, ptr %a, i64 %[[T3]]14; CHECK: %[[T6:.+]] = getelementptr inbounds nuw i8, ptr %[[T4]], i64 1615; CHECK: load <4 x i32>, ptr %[[T4]], align 416; CHECK: load <4 x i32>, ptr %[[T6]], align 417; CHECK: br {{.*}}, label %middle.block, label %vector.body18;19; NO-IC-LABEL: @scalar_after_vectorization_020;21; NO-IC: vector.body:22; NO-IC: %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]23; NO-IC: [[OFFSET_IDX:%.+]] = add i64 1, %index24; NO-IC: %[[T4:.+]] = add nuw nsw i64 [[OFFSET_IDX]], %tmp025; NO-IC: %[[T6:.+]] = sub nsw i64 %[[T4]], %x26; NO-IC: %[[T8:.+]] = getelementptr inbounds i32, ptr %a, i64 %[[T6]]27; NO-IC: %[[T12:.+]] = getelementptr inbounds i32, ptr %[[T8]], i64 428; NO-IC: load <4 x i32>, ptr %[[T8]], align 429; NO-IC: load <4 x i32>, ptr %[[T12]], align 430; NO-IC: br {{.*}}, label %middle.block, label %vector.body31;32define void @scalar_after_vectorization_0(ptr noalias %a, ptr noalias %b, i64 %x, i64 %y) {33 34outer.ph:35 br label %outer.body36 37outer.body:38 %i = phi i64 [ 1, %outer.ph ], [ %i.next, %inner.end ]39 %tmp0 = mul nuw nsw i64 %i, %x40 br label %inner.ph41 42inner.ph:43 br label %inner.body44 45inner.body:46 %j = phi i64 [ 1, %inner.ph ], [ %j.next, %inner.body ]47 %tmp1 = add nuw nsw i64 %j, %tmp048 %tmp2 = sub nsw i64 %tmp1, %x49 %tmp3 = getelementptr inbounds i32, ptr %a, i64 %tmp250 %tmp4 = load i32, ptr %tmp3, align 451 %tmp5 = getelementptr inbounds i32, ptr %b, i64 %tmp152 store i32 %tmp4, ptr %tmp5, align 453 %j.next = add i64 %j, 154 %cond.j = icmp slt i64 %j.next, %y55 br i1 %cond.j, label %inner.body, label %inner.end56 57inner.end:58 %i.next = add i64 %i, 159 %cond.i = icmp slt i64 %i.next, %y60 br i1 %cond.i, label %outer.body, label %outer.end61 62outer.end:63 ret void64}65