-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Test] Add test showing that SCEV cannot properly infer ranges of cyc…
…led phis
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py | ||
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s | ||
|
||
declare i1 @cond() | ||
|
||
; FIXME: Range of phi_1 and phi_2 here can be sharpened to [10, 21). | ||
define void @test_01() { | ||
; CHECK-LABEL: 'test_01' | ||
; CHECK-NEXT: Classifying expressions for: @test_01 | ||
; CHECK-NEXT: %phi_1 = phi i32 [ 10, %entry ], [ %phi_2, %loop ] | ||
; CHECK-NEXT: --> %phi_1 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } | ||
; CHECK-NEXT: %phi_2 = phi i32 [ 20, %entry ], [ %phi_1, %loop ] | ||
; CHECK-NEXT: --> %phi_2 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } | ||
; CHECK-NEXT: %cond = call i1 @cond() | ||
; CHECK-NEXT: --> %cond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant } | ||
; CHECK-NEXT: Determining loop execution counts for: @test_01 | ||
; CHECK-NEXT: Loop %loop: 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: | ||
%phi_1 = phi i32 [ 10, %entry], [%phi_2, %loop] | ||
%phi_2 = phi i32 [ 20, %entry], [%phi_1, %loop] | ||
%cond = call i1 @cond() | ||
br i1 %cond, label %loop, label %exit | ||
|
||
exit: | ||
ret void | ||
} |