Skip to content

Commit 7e3183d

Browse files
committed
Add test triggered by review discussion on D97077
1 parent a0757d8 commit 7e3183d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llvm/test/Analysis/ScalarEvolution/ranges.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ define i32 @ashr(i32 %a) {
2121
ret i32 %ashr
2222
}
2323

24+
; Highlight the fact that non-argument non-instructions are
25+
; also possible.
26+
@G = external global i8
27+
define i64 @ashr_global() {
28+
; CHECK-LABEL: 'ashr_global'
29+
; CHECK-NEXT: Classifying expressions for: @ashr_global
30+
; CHECK-NEXT: %ashr = ashr i64 ptrtoint (i8* @G to i64), 63
31+
; CHECK-NEXT: --> %ashr U: [-1,1) S: [-1,1)
32+
; CHECK-NEXT: Determining loop execution counts for: @ashr_global
33+
;
34+
%ashr = ashr i64 ptrtoint (i8* @G to i64), 63
35+
%pos = icmp sge i8* @G, null
36+
call void @llvm.assume(i1 %pos)
37+
ret i64 %ashr
38+
}
39+
40+
2441
define i32 @shl(i32 %a) {
2542
; CHECK-LABEL: 'shl'
2643
; CHECK-NEXT: Classifying expressions for: @shl

0 commit comments

Comments
 (0)