Skip to content

Commit 199862b

Browse files
committed
Rebase, require asserts for tests using debug output
1 parent 6d7bb66 commit 199862b

File tree

4 files changed

+62
-54
lines changed

4 files changed

+62
-54
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8431,7 +8431,7 @@ VPRecipeBuilder::tryToWidenHistogram(const HistogramInfo *HI,
84318431
// Bucket address.
84328432
HGramOps.push_back(Operands[1]);
84338433
// Increment value.
8434-
HGramOps.push_back(getVPValueOrAddLiveIn(HI->Update->getOperand(1), Plan));
8434+
HGramOps.push_back(getVPValueOrAddLiveIn(HI->Update->getOperand(1)));
84358435

84368436
// In case of predicated execution (due to tail-folding, or conditional
84378437
// execution, or both), pass the relevant mask.

llvm/test/Transforms/LoopVectorize/AArch64/sve2-histcnt-epilogue.ll

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
22
; RUN: opt < %s -passes=loop-vectorize,instcombine -enable-histogram-loop-vectorization -sve-gather-overhead=2 -sve-scatter-overhead=2 -epilogue-vectorization-minimum-VF=4 -debug-only=loop-vectorize -S 2>&1 | FileCheck %s
3+
; REQUIRES: asserts
34

45
target triple = "aarch64-unknown-linux-gnu"
56

@@ -13,27 +14,27 @@ define void @simple_histogram(ptr noalias %buckets, ptr readonly %indices, i64 %
1314
; CHECK-NEXT: entry:
1415
; CHECK-NEXT: [[TMP0:%.*]] = call i64 @llvm.vscale.i64()
1516
; CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 2
16-
; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ugt i64 [[TMP1]], [[N]]
17+
; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], [[TMP1]]
1718
; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
1819
; CHECK: vector.ph:
1920
; CHECK-NEXT: [[TMP2:%.*]] = call i64 @llvm.vscale.i64()
2021
; CHECK-NEXT: [[DOTNEG:%.*]] = mul nsw i64 [[TMP2]], -4
21-
; CHECK-NEXT: [[N_VEC:%.*]] = and i64 [[DOTNEG]], [[N]]
22+
; CHECK-NEXT: [[N_VEC:%.*]] = and i64 [[N]], [[DOTNEG]]
2223
; CHECK-NEXT: [[TMP4:%.*]] = call i64 @llvm.vscale.i64()
2324
; CHECK-NEXT: [[TMP5:%.*]] = shl nuw nsw i64 [[TMP4]], 2
2425
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
2526
; CHECK: vector.body:
2627
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
2728
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds i32, ptr [[INDICES]], i64 [[INDEX]]
28-
; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 4 x i32>, ptr [[TMP8]], align 4
29-
; CHECK-NEXT: [[TMP9:%.*]] = zext <vscale x 4 x i32> [[WIDE_LOAD]] to <vscale x 4 x i64>
30-
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], <vscale x 4 x i64> [[TMP9]]
31-
; CHECK-NEXT: call void @llvm.experimental.vector.histogram.add.nxv4p0.i32(<vscale x 4 x ptr> [[TMP10]], i32 1, <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
29+
; CHECK-NEXT: [[WIDE_LOAD1:%.*]] = load <vscale x 4 x i32>, ptr [[TMP8]], align 4
30+
; CHECK-NEXT: [[TMP14:%.*]] = zext <vscale x 4 x i32> [[WIDE_LOAD1]] to <vscale x 4 x i64>
31+
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], <vscale x 4 x i64> [[TMP14]]
32+
; CHECK-NEXT: call void @llvm.experimental.vector.histogram.add.nxv4p0.i32(<vscale x 4 x ptr> [[TMP15]], i32 1, <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
3233
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], [[TMP5]]
3334
; CHECK-NEXT: [[TMP11:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
3435
; CHECK-NEXT: br i1 [[TMP11]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
3536
; CHECK: middle.block:
36-
; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N_VEC]], [[N]]
37+
; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N]], [[N_VEC]]
3738
; CHECK-NEXT: br i1 [[CMP_N]], label [[FOR_EXIT:%.*]], label [[SCALAR_PH]]
3839
; CHECK: scalar.ph:
3940
; CHECK-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ]
@@ -67,10 +68,13 @@ for.body:
6768
store i32 %inc, ptr %arrayidx2, align 4
6869
%iv.next = add nuw nsw i64 %iv, 1
6970
%exitcond = icmp eq i64 %iv.next, %N
70-
br i1 %exitcond, label %for.exit, label %for.body
71+
br i1 %exitcond, label %for.exit, label %for.body, !llvm.loop !0
7172

7273
for.exit:
7374
ret void
7475
}
7576

7677
attributes #0 = { "target-features"="+sve2" vscale_range(1,16) }
78+
79+
!0 = distinct !{!0, !1}
80+
!1 = !{!"llvm.loop.interleave.count", i32 1}

llvm/test/Transforms/LoopVectorize/AArch64/sve2-histcnt-no-scalar-interleave.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
22
; RUN: opt < %s -passes=loop-vectorize,instcombine -enable-histogram-loop-vectorization -sve-gather-overhead=2 -sve-scatter-overhead=2 -debug-only=loop-vectorize -S 2>&1 | FileCheck %s
3+
; REQUIRES: asserts
34

45
;; Make sure we don't interleave a histogram when vectorization is disabled.
56

0 commit comments

Comments
 (0)