Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py | ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py | ||||
; This is the loop in c++ being vectorize in this file with | ; This is the loop in c++ being vectorize in this file with | ||||
;experimental.vector.reverse | ;experimental.vector.reverse | ||||
; #pragma clang loop vectorize_width(4, scalable) | ; #pragma clang loop vectorize_width(4, scalable) | ||||
; for (int i = N-1; i >= 0; --i) | ; for (int i = N-1; i >= 0; --i) | ||||
; a[i] = b[i] + 1.0; | ; a[i] = b[i] + 1.0; | ||||
; REQUIRES: asserts | ; REQUIRES: asserts | ||||
; RUN: opt -loop-vectorize -dce -instcombine -mtriple riscv64-linux-gnu \ | ; RUN: opt -loop-vectorize -dce -instcombine -mtriple riscv64-linux-gnu \ | ||||
; RUN: -mattr=+v -debug-only=loop-vectorize -scalable-vectorization=on \ | ; RUN: -mattr=+v -debug-only=loop-vectorize -scalable-vectorization=on \ | ||||
; RUN: -riscv-v-vector-bits-min=128 -disable-output < %s 2>&1 | FileCheck %s | ; RUN: -riscv-v-vector-bits-min=128 -disable-output < %s 2>&1 | FileCheck %s | ||||
define void @vector_reverse_i64(ptr nocapture noundef writeonly %A, ptr nocapture noundef readonly %B, i32 noundef signext %n) { | define void @vector_reverse_i64(ptr nocapture noundef writeonly %A, ptr nocapture noundef readonly %B, i32 noundef signext %n) { | ||||
; CHECK-LABEL: 'vector_reverse_i64' | ; CHECK-LABEL: 'vector_reverse_i64' | ||||
; CHECK-NEXT: LV: Loop hints: force=enabled width=vscale x 4 interleave=0 | ; CHECK-NEXT: LV: Loop hints: force_vectorization=enabled width=vscale x 4 force_interleave=? interleave=0 | ||||
; CHECK-NEXT: LV: Found a loop: for.body | ; CHECK-NEXT: LV: Found a loop: for.body | ||||
; CHECK-NEXT: LV: Found an induction variable. | ; CHECK-NEXT: LV: Found an induction variable. | ||||
; CHECK-NEXT: LV: Found an induction variable. | ; CHECK-NEXT: LV: Found an induction variable. | ||||
; CHECK-NEXT: LV: Did not find one integer induction var. | ; CHECK-NEXT: LV: Did not find one integer induction var. | ||||
; CHECK-NEXT: LV: We can vectorize this loop (with a runtime bound check)! | ; CHECK-NEXT: LV: We can vectorize this loop (with a runtime bound check)! | ||||
; CHECK-NEXT: LV: Found trip count: 0 | ; CHECK-NEXT: LV: Found trip count: 0 | ||||
; CHECK-NEXT: LV: Scalable vectorization is available | ; CHECK-NEXT: LV: Scalable vectorization is available | ||||
; CHECK-NEXT: LV: The max safe fixed VF is: 67108864. | ; CHECK-NEXT: LV: The max safe fixed VF is: 67108864. | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | for.body: ; preds = %for.body.preheader, %for.body | ||||
store i32 %add9, ptr %arrayidx3, align 4 | store i32 %add9, ptr %arrayidx3, align 4 | ||||
%cmp = icmp ugt i64 %indvars.iv, 1 | %cmp = icmp ugt i64 %indvars.iv, 1 | ||||
%indvars.iv.next = add nsw i64 %indvars.iv, -1 | %indvars.iv.next = add nsw i64 %indvars.iv, -1 | ||||
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !0 | br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !0 | ||||
} | } | ||||
define void @vector_reverse_f32(ptr nocapture noundef writeonly %A, ptr nocapture noundef readonly %B, i32 noundef signext %n) { | define void @vector_reverse_f32(ptr nocapture noundef writeonly %A, ptr nocapture noundef readonly %B, i32 noundef signext %n) { | ||||
; CHECK-LABEL: 'vector_reverse_f32' | ; CHECK-LABEL: 'vector_reverse_f32' | ||||
; CHECK-NEXT: LV: Loop hints: force=enabled width=vscale x 4 interleave=0 | ; CHECK-NEXT: LV: Loop hints: force_vectorization=enabled width=vscale x 4 force_interleave=? interleave=0 | ||||
; CHECK-NEXT: LV: Found a loop: for.body | ; CHECK-NEXT: LV: Found a loop: for.body | ||||
; CHECK-NEXT: LV: Found an induction variable. | ; CHECK-NEXT: LV: Found an induction variable. | ||||
; CHECK-NEXT: LV: Found an induction variable. | ; CHECK-NEXT: LV: Found an induction variable. | ||||
; CHECK-NEXT: LV: Found FP op with unsafe algebra. | ; CHECK-NEXT: LV: Found FP op with unsafe algebra. | ||||
; CHECK-NEXT: LV: Did not find one integer induction var. | ; CHECK-NEXT: LV: Did not find one integer induction var. | ||||
; CHECK-NEXT: LV: We can vectorize this loop (with a runtime bound check)! | ; CHECK-NEXT: LV: We can vectorize this loop (with a runtime bound check)! | ||||
; CHECK-NEXT: LV: Found trip count: 0 | ; CHECK-NEXT: LV: Found trip count: 0 | ||||
; CHECK-NEXT: LV: Scalable vectorization is available | ; CHECK-NEXT: LV: Scalable vectorization is available | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |