[llvm] d003c01 - [LV][IndVars] Move test to correct directory and regenerate (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 09:03:49 PDT 2023


Author: Nikita Popov
Date: 2023-04-21T18:03:41+02:00
New Revision: d003c01c302978a7397b3caeb06c6ca0e5f1b6da

URL: https://github.com/llvm/llvm-project/commit/d003c01c302978a7397b3caeb06c6ca0e5f1b6da
DIFF: https://github.com/llvm/llvm-project/commit/d003c01c302978a7397b3caeb06c6ca0e5f1b6da.diff

LOG: [LV][IndVars] Move test to correct directory and regenerate (NFC)

For some reason, an IndVarSimplify test was in the LoopVectorize
directory.

Added: 
    llvm/test/Transforms/IndVarSimplify/pr30806-phi-scev.ll

Modified: 
    

Removed: 
    llvm/test/Transforms/LoopVectorize/pr30806-phi-scev.ll


################################################################################
diff  --git a/llvm/test/Transforms/LoopVectorize/pr30806-phi-scev.ll b/llvm/test/Transforms/IndVarSimplify/pr30806-phi-scev.ll
similarity index 54%
rename from llvm/test/Transforms/LoopVectorize/pr30806-phi-scev.ll
rename to llvm/test/Transforms/IndVarSimplify/pr30806-phi-scev.ll
index 7fa17850d8b1b..b45f0946399f9 100644
--- a/llvm/test/Transforms/LoopVectorize/pr30806-phi-scev.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr30806-phi-scev.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
 ; RUN: opt -S -passes=indvars < %s | FileCheck %s
 
 ; Produced from the test-case:
@@ -24,7 +25,37 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
 @theSize = external local_unnamed_addr global i32, align 4
 
+; Check that there are two PHIs followed by a 'sext' in the same block, and that
+; the test does not crash.
 define void @foo(ptr %buf, i32 %denominator, ptr %flag) local_unnamed_addr {
+; CHECK-LABEL: define void @foo
+; CHECK-SAME: (ptr [[BUF:%.*]], i32 [[DENOMINATOR:%.*]], ptr [[FLAG:%.*]]) local_unnamed_addr {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[I:%.*]] = alloca i32, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @theSize, align 4
+; CHECK-NEXT:    [[DIV:%.*]] = udiv i32 [[TMP0]], [[DENOMINATOR]]
+; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[FLAG]], align 4
+; CHECK-NEXT:    [[TOBOOL5:%.*]] = icmp eq i32 [[TMP1]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL5]], label [[WHILE_END:%.*]], label [[WHILE_BODY_LR_PH:%.*]]
+; CHECK:       while.body.lr.ph:
+; CHECK-NEXT:    br label [[WHILE_BODY:%.*]]
+; CHECK:       while.body:
+; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[WHILE_BODY]] ], [ 0, [[WHILE_BODY_LR_PH]] ]
+; CHECK-NEXT:    [[BUF_ADDR_07:%.*]] = phi ptr [ [[BUF]], [[WHILE_BODY_LR_PH]] ], [ [[CALL:%.*]], [[WHILE_BODY]] ]
+; CHECK-NEXT:    [[TMP2:%.*]] = sext i32 [[DIV]] to i64
+; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add i64 [[INDVARS_IV]], [[TMP2]]
+; CHECK-NEXT:    [[TMP3:%.*]] = load i32, ptr @theSize, align 4
+; CHECK-NEXT:    store i32 [[TMP3]], ptr [[I]], align 4
+; CHECK-NEXT:    call void @bar(ptr nonnull [[I]], i64 [[INDVARS_IV_NEXT]])
+; CHECK-NEXT:    [[CALL]] = call ptr @processBuf(ptr [[BUF_ADDR_07]])
+; CHECK-NEXT:    [[TMP4:%.*]] = load i32, ptr [[FLAG]], align 4
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[TMP4]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[WHILE_END_LOOPEXIT:%.*]], label [[WHILE_BODY]]
+; CHECK:       while.end.loopexit:
+; CHECK-NEXT:    br label [[WHILE_END]]
+; CHECK:       while.end:
+; CHECK-NEXT:    ret void
+;
 entry:
   %i = alloca i32, align 4
   %0 = load i32, ptr @theSize, align 4
@@ -37,11 +68,6 @@ while.body.lr.ph:                                 ; preds = %entry
   br label %while.body
 
 while.body:                                       ; preds = %while.body.lr.ph, %while.body
-; Check that there are two PHIs followed by a 'sext' in the same block, and that
-; the test does not crash.
-; CHECK:        phi
-; CHECK-NEXT:   phi
-; CHECK-NEXT:   sext
   %buf.addr.07 = phi ptr [ %buf, %while.body.lr.ph ], [ %call, %while.body ]
   %inx.06 = phi i32 [ 0, %while.body.lr.ph ], [ %add, %while.body ]
   %add = add nsw i32 %inx.06, %div


        


More information about the llvm-commits mailing list