[llvm] 4a42ce2 - [LoopVersioning] Check the full generated runtime checks in lcssa.ll.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 00:37:46 PST 2022


Author: Florian Hahn
Date: 2022-01-11T08:37:30Z
New Revision: 4a42ce25088e2958946a34f6671e4c3c651311aa

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

LOG: [LoopVersioning] Check the full generated runtime checks in lcssa.ll.

This makes improvements in follow-up patches more obvious.

Added: 
    

Modified: 
    llvm/test/Transforms/LoopVersioning/lcssa.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LoopVersioning/lcssa.ll b/llvm/test/Transforms/LoopVersioning/lcssa.ll
index 2865e2cc8e66d..4a7b120744ccf 100644
--- a/llvm/test/Transforms/LoopVersioning/lcssa.ll
+++ b/llvm/test/Transforms/LoopVersioning/lcssa.ll
@@ -2,8 +2,19 @@
 target triple = "x86_64-unknown-linux-gnu"
 
 define void @fill(i8** %ls1.20, i8** %ls2.21, i8* %cse3.22) {
-; CHECK: bb1.lver.check:
-; CHECK:   br i1 %found.conflict, label %bb1.ph.lver.orig, label %bb1.ph
+; CHECK-LABEL: @fill(
+; CHECK-NEXT:  bb1.lver.check:
+; CHECK-NEXT:    [[LS1_20_PROMOTED:%.*]] = load i8*, i8** [[LS1_20:%.*]], align 8
+; CHECK-NEXT:    [[LS2_21_PROMOTED:%.*]] = load i8*, i8** [[LS2_21:%.*]], align 8
+; CHECK-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* [[LS1_20_PROMOTED]], i64 -1
+; CHECK-NEXT:    [[SCEVGEP1:%.*]] = getelementptr i8, i8* [[LS1_20_PROMOTED]], i64 1
+; CHECK-NEXT:    [[SCEVGEP2:%.*]] = getelementptr i8, i8* [[LS2_21_PROMOTED]], i64 1
+; CHECK-NEXT:    [[BOUND0:%.*]] = icmp ult i8* [[SCEVGEP]], [[SCEVGEP2]]
+; CHECK-NEXT:    [[BOUND1:%.*]] = icmp ult i8* [[LS2_21_PROMOTED]], [[SCEVGEP1]]
+; CHECK-NEXT:    [[FOUND_CONFLICT:%.*]] = and i1 [[BOUND0]], [[BOUND1]]
+; CHECK-NEXT:    br i1 [[FOUND_CONFLICT]], label %bb1.ph.lver.orig, label %bb1.ph
+; CHECK:       bb1.ph.lver.orig:
+;
 bb1.ph:
   %ls1.20.promoted = load i8*, i8** %ls1.20
   %ls2.21.promoted = load i8*, i8** %ls2.21
@@ -35,10 +46,26 @@ bb3:
 }
 
 define void @fill_no_null_opt(i8** %ls1.20, i8** %ls2.21, i8* %cse3.22) #0 {
-; CHECK-LABEL: fill_no_null_opt(
-; CHECK: bb1.lver.check:
-; CHECK: %lver.safe = or i1 %found.conflict, %{{.*}}
-; CHECK:  br i1 %lver.safe, label %bb1.ph.lver.orig, label %bb1.ph
+; CHECK-LABEL: @fill_no_null_opt(
+; CHECK-NEXT:  bb1.lver.check:
+; CHECK-NEXT:    [[LS1_20_PROMOTED:%.*]] = load i8*, i8** [[LS1_20:%.*]], align 8
+; CHECK-NEXT:    [[LS2_21_PROMOTED:%.*]] = load i8*, i8** [[LS2_21:%.*]], align 8
+; CHECK-NEXT:    [[SCEVGEP:%.*]] = getelementptr i8, i8* [[LS1_20_PROMOTED]], i64 -1
+; CHECK-NEXT:    [[SCEVGEP1:%.*]] = getelementptr i8, i8* [[LS1_20_PROMOTED]], i64 1
+; CHECK-NEXT:    [[SCEVGEP2:%.*]] = getelementptr i8, i8* [[LS2_21_PROMOTED]], i64 1
+; CHECK-NEXT:    [[BOUND0:%.*]] = icmp ult i8* [[SCEVGEP]], [[SCEVGEP2]]
+; CHECK-NEXT:    [[BOUND1:%.*]] = icmp ult i8* [[LS2_21_PROMOTED]], [[SCEVGEP1]]
+; CHECK-NEXT:    [[FOUND_CONFLICT:%.*]] = and i1 [[BOUND0]], [[BOUND1]]
+; CHECK-NEXT:    [[SCEVGEP3:%.*]] = getelementptr i8, i8* [[LS1_20_PROMOTED]], i64 -1
+; CHECK-NEXT:    [[TMP0:%.*]] = getelementptr i8, i8* [[SCEVGEP3]], i64 0
+; CHECK-NEXT:    [[TMP1:%.*]] = icmp ult i8* [[TMP0]], [[SCEVGEP3]]
+; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr i8, i8* [[LS1_20_PROMOTED]], i64 0
+; CHECK-NEXT:    [[TMP3:%.*]] = icmp ult i8* [[TMP2]], [[LS1_20_PROMOTED]]
+; CHECK-NEXT:    [[TMP4:%.*]] = or i1 [[TMP1]], [[TMP3]]
+; CHECK-NEXT:    [[LVER_SAFE:%.*]] = or i1 [[FOUND_CONFLICT]], [[TMP4]]
+; CHECK-NEXT:    br i1 [[LVER_SAFE]], label %bb1.ph.lver.orig, label %bb1.ph
+; CHECK:       bb1.ph.lver.orig:
+;
 bb1.ph:
   %ls1.20.promoted = load i8*, i8** %ls1.20
   %ls2.21.promoted = load i8*, i8** %ls2.21


        


More information about the llvm-commits mailing list