mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
ab043ff680
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 llvm-svn: 230794
39 lines
1.1 KiB
LLVM
39 lines
1.1 KiB
LLVM
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
|
|
|
|
@mode_table = global [4 x i32] zeroinitializer ; <[4 x i32]*> [#uses=1]
|
|
|
|
; CHECK: max backedge-taken count is 1{{$}}
|
|
|
|
define i8 @f() {
|
|
entry:
|
|
tail call i32 @fegetround( ) ; <i32>:0 [#uses=1]
|
|
br label %bb
|
|
|
|
bb: ; preds = %bb4, %entry
|
|
%mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb4 ] ; <i8> [#uses=4]
|
|
zext i8 %mode.0 to i32 ; <i32>:1 [#uses=1]
|
|
getelementptr [4 x i32], [4 x i32]* @mode_table, i32 0, i32 %1 ; <i32*>:2 [#uses=1]
|
|
load i32, i32* %2, align 4 ; <i32>:3 [#uses=1]
|
|
icmp eq i32 %3, %0 ; <i1>:4 [#uses=1]
|
|
br i1 %4, label %bb1, label %bb2
|
|
|
|
bb1: ; preds = %bb
|
|
ret i8 %mode.0
|
|
|
|
bb2: ; preds = %bb
|
|
icmp eq i8 %mode.0, 1 ; <i1>:5 [#uses=1]
|
|
br i1 %5, label %bb5, label %bb4
|
|
|
|
bb4: ; preds = %bb2
|
|
%indvar.next = add i8 %mode.0, 1 ; <i8> [#uses=1]
|
|
br label %bb
|
|
|
|
bb5: ; preds = %bb2
|
|
tail call void @raise_exception( ) noreturn
|
|
unreachable
|
|
}
|
|
|
|
declare i32 @fegetround()
|
|
|
|
declare void @raise_exception() noreturn
|