[llvm] 60470e1 - [LoopUnroll] Add script test checks for LoopUnroll/X86/mmx.ll

Joshua Cao via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 20:12:12 PDT 2023


Author: Joshua Cao
Date: 2023-04-10T19:59:01-07:00
New Revision: 60470e163a9b6f6586512757bf81aa5159aeda25

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

LOG: [LoopUnroll] Add script test checks for LoopUnroll/X86/mmx.ll

Added: 
    

Modified: 
    llvm/test/Transforms/LoopUnroll/X86/mmx.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LoopUnroll/X86/mmx.ll b/llvm/test/Transforms/LoopUnroll/X86/mmx.ll
index 3a11c459002fa..9318bd190f9ba 100644
--- a/llvm/test/Transforms/LoopUnroll/X86/mmx.ll
+++ b/llvm/test/Transforms/LoopUnroll/X86/mmx.ll
@@ -1,8 +1,61 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
 ; RUN: opt < %s -S -passes=loop-unroll | FileCheck %s
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 define x86_mmx @f() #0 {
+; CHECK-LABEL: define x86_mmx @f
+; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br i1 false, label [[EXIT_UNR_LCSSA:%.*]], label [[ENTRY_NEW:%.*]]
+; CHECK:       entry.new:
+; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
+; CHECK:       for.body:
+; CHECK-NEXT:    [[PHI:%.*]] = phi i32 [ 1, [[ENTRY_NEW]] ], [ [[ADD_7:%.*]], [[FOR_BODY]] ]
+; CHECK-NEXT:    [[NITER:%.*]] = phi i32 [ 0, [[ENTRY_NEW]] ], [ [[NITER_NEXT_7:%.*]], [[FOR_BODY]] ]
+; CHECK-NEXT:    [[ADD:%.*]] = add nuw nsw i32 [[PHI]], 1
+; CHECK-NEXT:    [[NITER_NEXT:%.*]] = add nuw nsw i32 [[NITER]], 1
+; CHECK-NEXT:    [[ADD_1:%.*]] = add nuw nsw i32 [[ADD]], 1
+; CHECK-NEXT:    [[NITER_NEXT_1:%.*]] = add nuw nsw i32 [[NITER_NEXT]], 1
+; CHECK-NEXT:    [[ADD_2:%.*]] = add nuw nsw i32 [[ADD_1]], 1
+; CHECK-NEXT:    [[NITER_NEXT_2:%.*]] = add nuw nsw i32 [[NITER_NEXT_1]], 1
+; CHECK-NEXT:    [[ADD_3:%.*]] = add nuw nsw i32 [[ADD_2]], 1
+; CHECK-NEXT:    [[NITER_NEXT_3:%.*]] = add nuw nsw i32 [[NITER_NEXT_2]], 1
+; CHECK-NEXT:    [[ADD_4:%.*]] = add nuw nsw i32 [[ADD_3]], 1
+; CHECK-NEXT:    [[NITER_NEXT_4:%.*]] = add nuw nsw i32 [[NITER_NEXT_3]], 1
+; CHECK-NEXT:    [[ADD_5:%.*]] = add nuw nsw i32 [[ADD_4]], 1
+; CHECK-NEXT:    [[NITER_NEXT_5:%.*]] = add nuw nsw i32 [[NITER_NEXT_4]], 1
+; CHECK-NEXT:    [[ADD_6:%.*]] = add i32 [[ADD_5]], 1
+; CHECK-NEXT:    [[NITER_NEXT_6:%.*]] = add nuw nsw i32 [[NITER_NEXT_5]], 1
+; CHECK-NEXT:    [[ADD_7]] = add nuw nsw i32 [[ADD_6]], 1
+; CHECK-NEXT:    [[NITER_NEXT_7]] = add i32 [[NITER_NEXT_6]], 1
+; CHECK-NEXT:    [[NITER_NCMP_7:%.*]] = icmp eq i32 [[NITER_NEXT_7]], 0
+; CHECK-NEXT:    br i1 [[NITER_NCMP_7]], label [[EXIT_UNR_LCSSA_LOOPEXIT:%.*]], label [[FOR_BODY]]
+; CHECK:       exit.unr-lcssa.loopexit:
+; CHECK-NEXT:    [[RET_PH_PH:%.*]] = phi x86_mmx [ undef, [[FOR_BODY]] ]
+; CHECK-NEXT:    [[PHI_UNR_PH:%.*]] = phi i32 [ [[ADD_7]], [[FOR_BODY]] ]
+; CHECK-NEXT:    br label [[EXIT_UNR_LCSSA]]
+; CHECK:       exit.unr-lcssa:
+; CHECK-NEXT:    [[RET_PH:%.*]] = phi x86_mmx [ undef, [[ENTRY:%.*]] ], [ [[RET_PH_PH]], [[EXIT_UNR_LCSSA_LOOPEXIT]] ]
+; CHECK-NEXT:    [[PHI_UNR:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[PHI_UNR_PH]], [[EXIT_UNR_LCSSA_LOOPEXIT]] ]
+; CHECK-NEXT:    br i1 false, label [[FOR_BODY_EPIL_PREHEADER:%.*]], label [[EXIT:%.*]]
+; CHECK:       for.body.epil.preheader:
+; CHECK-NEXT:    br label [[FOR_BODY_EPIL:%.*]]
+; CHECK:       for.body.epil:
+; CHECK-NEXT:    [[PHI_EPIL:%.*]] = phi i32 [ [[PHI_UNR]], [[FOR_BODY_EPIL_PREHEADER]] ], [ [[ADD_EPIL:%.*]], [[FOR_BODY_EPIL]] ]
+; CHECK-NEXT:    [[EPIL_ITER:%.*]] = phi i32 [ 0, [[FOR_BODY_EPIL_PREHEADER]] ], [ [[EPIL_ITER_NEXT:%.*]], [[FOR_BODY_EPIL]] ]
+; CHECK-NEXT:    [[ADD_EPIL]] = add i32 [[PHI_EPIL]], 1
+; CHECK-NEXT:    [[CMP_EPIL:%.*]] = icmp eq i32 [[PHI_EPIL]], 0
+; CHECK-NEXT:    [[EPIL_ITER_NEXT]] = add i32 [[EPIL_ITER]], 1
+; CHECK-NEXT:    [[EPIL_ITER_CMP:%.*]] = icmp ne i32 [[EPIL_ITER_NEXT]], 0
+; CHECK-NEXT:    br i1 [[EPIL_ITER_CMP]], label [[FOR_BODY_EPIL]], label [[EXIT_EPILOG_LCSSA:%.*]], !llvm.loop [[LOOP0:![0-9]+]]
+; CHECK:       exit.epilog-lcssa:
+; CHECK-NEXT:    [[RET_PH1:%.*]] = phi x86_mmx [ undef, [[FOR_BODY_EPIL]] ]
+; CHECK-NEXT:    br label [[EXIT]]
+; CHECK:       exit:
+; CHECK-NEXT:    [[RET:%.*]] = phi x86_mmx [ [[RET_PH]], [[EXIT_UNR_LCSSA]] ], [ [[RET_PH1]], [[EXIT_EPILOG_LCSSA]] ]
+; CHECK-NEXT:    ret x86_mmx [[RET]]
+;
 entry:
   br label %for.body
 
@@ -14,10 +67,6 @@ for.body:                                         ; preds = %for.body, %entry
 
 exit:                                             ; preds = %for.body
   %ret = phi x86_mmx [ undef, %for.body ]
-  ; CHECK: %[[ret_ph:.*]] = phi x86_mmx [ undef, %entry
-  ; CHECK: %[[ret_ph1:.*]]  = phi x86_mmx [ undef,
-  ; CHECK: %[[ret:.*]] = phi x86_mmx [ %[[ret_ph]], {{.*}} ], [ %[[ret_ph1]],
-  ; CHECK: ret x86_mmx %[[ret]]
   ret x86_mmx %ret
 }
 


        


More information about the llvm-commits mailing list