52 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=loop-vectorize \3; RUN: -force-tail-folding-style=data-with-evl \4; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \5; RUN: -mtriple=powerpc64le-unknown-linux-gnu \6; RUN: -mcpu=pwr10 -S < %s | FileCheck %s7 8; RUN: opt -passes=loop-vectorize \9; RUN: -force-tail-folding-style=none \10; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \11; RUN: -mtriple=powerpc64le-unknown-linux-gnu \12; RUN: -mcpu=pwr10 -S < %s | FileCheck %s13 14define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) {15; CHECK-LABEL: @foo(16; CHECK-NEXT: entry:17; CHECK-NEXT: br label [[FOR_BODY:%.*]]18; CHECK: for.body:19; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[FOR_BODY]] ]20; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[B:%.*]], i64 [[IV]]21; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 422; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i32, ptr [[C:%.*]], i64 [[IV]]23; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX2]], align 424; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP0]]25; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[IV]]26; CHECK-NEXT: store i32 [[ADD]], ptr [[ARRAYIDX4]], align 427; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[IV]], 128; CHECK-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i64 [[IV_NEXT]], [[N:%.*]]29; CHECK-NEXT: br i1 [[EXITCOND_NOT]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY]]30; CHECK: for.cond.cleanup:31; CHECK-NEXT: ret void32;33entry:34 br label %for.body35 36for.body:37 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]38 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %iv39 %0 = load i32, ptr %arrayidx, align 440 %arrayidx2 = getelementptr inbounds i32, ptr %c, i64 %iv41 %1 = load i32, ptr %arrayidx2, align 442 %add = add nsw i32 %1, %043 %arrayidx4 = getelementptr inbounds i32, ptr %a, i64 %iv44 store i32 %add, ptr %arrayidx4, align 445 %iv.next = add nuw nsw i64 %iv, 146 %exitcond.not = icmp eq i64 %iv.next, %N47 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body48 49for.cond.cleanup:50 ret void51}52