Skip to content

Commit

Permalink
[SCEV] Add range test with phi and division.
Browse files Browse the repository at this point in the history
Extra test coverage for D130728.
  • Loading branch information
fhahn committed Nov 21, 2022
1 parent 71b2ff7 commit 535c2da
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions llvm/test/Analysis/ScalarEvolution/ranges.ll
Expand Up @@ -103,3 +103,24 @@ define i64 @zext(i8 %a) {
call void @llvm.assume(i1 %pos)
ret i64 %res
}

define i32 @phi_div() {
; CHECK-LABEL: 'phi_div'
; CHECK-NEXT: Classifying expressions for: @phi_div
; CHECK-NEXT: %range.1 = phi i32 [ 0, %entry ], [ %shr, %loop ]
; CHECK-NEXT: --> %range.1 U: [0,1) S: [0,1) Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
; CHECK-NEXT: %shr = lshr i32 %range.1, 1
; CHECK-NEXT: --> (%range.1 /u 2) U: [0,1) S: [0,1) Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
; CHECK-NEXT: Determining loop execution counts for: @phi_div
; CHECK-NEXT: Loop %loop: <multiple exits> Unpredictable backedge-taken count.
; CHECK-NEXT: Loop %loop: Unpredictable max backedge-taken count.
; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count.
;
entry:
br label %loop

loop:
%range.1 = phi i32 [ 0, %entry ], [ %shr, %loop ]
%shr = lshr i32 %range.1, 1
br label %loop
}

0 comments on commit 535c2da

Please sign in to comment.