From: Philip Reames Date: Tue, 24 Aug 2021 21:28:57 +0000 (-0700) Subject: [tests] Add a couple tests for intersection of ec8d87e and D108651 X-Git-Tag: upstream/15.0.7~33125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d235bf75d04b9727395af9efed74118227dbc10;p=platform%2Fupstream%2Fllvm.git [tests] Add a couple tests for intersection of ec8d87e and D108651 --- diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll b/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll index 7865548..ce2136b 100644 --- a/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll +++ b/llvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll @@ -27,6 +27,24 @@ for.end: ; preds = %for.body, %entry ret void } +; CHECK-LABEL: Determining loop execution counts for: @neg_nw_nuw +; CHECK: Loop %for.body: Unpredictable backedge-taken count +; CHECK: Loop %for.body: Unpredictable max backedge-taken count +define void @neg_nw_nuw(i16 %n) mustprogress { +entry: + br label %for.body + +for.body: ; preds = %entry, %for.body + %iv = phi i8 [ %iv.next, %for.body ], [ 0, %entry ] + %iv.next = add i8 %iv, -1 + %zext = zext i8 %iv to i16 + %cmp = icmp ult i16 %zext, %n + br i1 %cmp, label %for.body, label %for.end + +for.end: ; preds = %for.body, %entry + ret void +} + ; CHECK-LABEL: Determining loop execution counts for: @nw_implies_nsw ; CHECK: Loop %for.body: Unpredictable backedge-taken count ; CHECK: Loop %for.body: Unpredictable max backedge-taken count @@ -45,6 +63,24 @@ for.end: ; preds = %for.body, %entry ret void } +; CHECK-LABEL: Determining loop execution counts for: @neg_nw_nsw +; CHECK: Loop %for.body: Unpredictable backedge-taken count +; CHECK: Loop %for.body: Unpredictable max backedge-taken count +define void @neg_nw_nsw(i16 %n) mustprogress { +entry: + br label %for.body + +for.body: ; preds = %entry, %for.body + %iv = phi i8 [ %iv.next, %for.body ], [ -128, %entry ] + %iv.next = add i8 %iv, -1 + %zext = sext i8 %iv to i16 + %cmp = icmp slt i16 %zext, %n + br i1 %cmp, label %for.body, label %for.end + +for.end: ; preds = %for.body, %entry + ret void +} + ; CHECK-LABEL: Determining loop execution counts for: @actually_infinite ; CHECK: Loop %for.body: Unpredictable backedge-taken count