From cdb48eefd07b5f2dcc381ab62a4ad796c2012476 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 13 Apr 2023 20:23:56 +0100 Subject: [PATCH] [LV] Add exit users for recurrences in test, fix names. Add users of exit values for recurrences to make sure exit value generation will be checked in a follow-up change. Also adjusts/fixes naming in the test. --- .../LoopVectorize/first-order-recurrence-chains.ll | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll b/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll index dc7fc9d..5e23507 100644 --- a/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll +++ b/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll @@ -649,7 +649,7 @@ exit: ; Make sure LLVM doesn't generate wrong data in SinkAfter, and causes crash in ; loop vectorizer. -define void @test_crash(ptr %p) { +define double @test_crash(ptr %p, ptr noalias %a, ptr noalias %b) { ; CHECK-LABEL: @test_crash ; CHECK-NOT: vector.body: ; CHECK: ret @@ -657,19 +657,21 @@ Entry: br label %Loop Loop: - %for.1 = phi double [ %iv1, %Loop ], [ 0.000000e+00, %Entry ] - %for.2 = phi double [ %iv2, %Loop ], [ 0.000000e+00, %Entry ] + %for.1 = phi double [ %l1, %Loop ], [ 0.000000e+00, %Entry ] + %for.2 = phi double [ %l2, %Loop ], [ 0.000000e+00, %Entry ] %for.3 = phi double [ %for.2, %Loop ], [ 0.000000e+00, %Entry ] - %for.4 = phi i64 [ %count, %Loop ], [ 0, %Entry ] + %iv = phi i64 [ %iv.next, %Loop ], [ 0, %Entry ] %USE_2_INDVARS = fdiv double %for.3, %for.1 %div = fdiv double 0.000000e+00, %for.1 - %iv1 = load double, ptr null, align 8 - %count = add nuw nsw i64 %for.4, 1 - %iv2 = load double, ptr null, align 8 + %l1 = load double, ptr %a, align 8 + %iv.next= add nuw nsw i64 %iv, 1 + %l2 = load double, ptr %b, align 8 store double %div, ptr %p, align 8 - %cond = icmp eq i64 %count, 0 + %cond = icmp eq i64 %iv.next, 0 br i1 %cond, label %End, label %Loop End: - ret void + %res.1 = fadd double %for.1, %for.2 + %res.2 = fadd double %res.1, %for.3 + ret double %res.2 } -- 2.7.4