41 lines · plain
1; RUN: opt < %s -mattr=+sve2 -passes=loop-vectorize,instcombine -enable-histogram-loop-vectorization -sve-gather-overhead=2 -sve-scatter-overhead=2 -debug-only=loop-vectorize --disable-output -S 2>&1 | FileCheck %s2; REQUIRES: asserts3 4target triple = "aarch64-unknown-linux-gnu"5 6;; Make sure we don't detect a histogram operation if the index address is7;; loop invariant.8; CHECK: LV: Checking for a histogram on: store i32 %inc, ptr %gep.bucket, align 49; CHECK-NEXT: LV: Can't vectorize due to memory conflicts10; CHECK-NEXT: LV: Not vectorizing: Cannot prove legality.11 12define void @outer_loop_scevaddrec(ptr noalias %buckets, ptr readonly %indices, i64 %N, i64 %M) {13entry:14 br label %outer.header15 16outer.header:17 %outer.iv = phi i64 [ 0, %entry ], [ %outer.iv.next, %outer.latch ]18 %gep.indices = getelementptr inbounds i32, ptr %indices, i64 %outer.iv19 br label %inner.body20 21inner.body:22 %iv = phi i64 [ 0, %outer.header ], [ %iv.next, %inner.body ]23 %l.idx = load i32, ptr %gep.indices, align 424 %idxprom1 = zext i32 %l.idx to i6425 %gep.bucket = getelementptr inbounds i32, ptr %buckets, i64 %idxprom126 %l.bucket = load i32, ptr %gep.bucket, align 427 %inc = add nsw i32 %l.bucket, 128 store i32 %inc, ptr %gep.bucket, align 429 %iv.next = add nuw nsw i64 %iv, 130 %exitcond = icmp eq i64 %iv.next, %N31 br i1 %exitcond, label %outer.latch, label %inner.body32 33outer.latch:34 %outer.iv.next = add nuw nsw i64 %outer.iv, 135 %outer.exitcond = icmp eq i64 %outer.iv.next, %M36 br i1 %outer.exitcond, label %outer.exit, label %outer.header37 38outer.exit:39 ret void40}41