2010-11-14 21:30:18 +08:00
|
|
|
; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
|
2007-07-27 02:26:51 +08:00
|
|
|
|
2010-11-14 21:30:18 +08:00
|
|
|
@last = external global [65 x i32*]
|
2007-07-27 02:26:51 +08:00
|
|
|
|
2013-11-12 06:00:23 +08:00
|
|
|
define i32 @NextRootMove(i32 %wtm, i32 %x, i32 %y, i32 %z) {
|
2010-11-14 21:30:18 +08:00
|
|
|
entry:
|
2011-05-22 15:02:43 +08:00
|
|
|
%A = alloca i32*
|
2015-03-14 02:20:45 +08:00
|
|
|
%tmp17618 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
|
2011-05-22 15:02:43 +08:00
|
|
|
store i32* %tmp17618, i32** %A
|
2010-11-14 21:30:18 +08:00
|
|
|
; CHECK: entry:
|
2011-05-22 15:02:43 +08:00
|
|
|
; CHECK-NEXT: alloca i32
|
2010-11-14 21:30:18 +08:00
|
|
|
; CHECK-NEXT: %tmp17618 = load
|
|
|
|
; CHECK-NOT: load
|
|
|
|
; CHECK-NOT: phi
|
2007-07-27 02:26:51 +08:00
|
|
|
br label %cond_true116
|
|
|
|
|
2010-11-14 21:30:18 +08:00
|
|
|
cond_true116:
|
2013-11-12 06:00:23 +08:00
|
|
|
%cmp = icmp eq i32 %x, %y
|
|
|
|
br i1 %cmp, label %cond_true128, label %cond_true145
|
2007-07-27 02:26:51 +08:00
|
|
|
|
2010-11-14 21:30:18 +08:00
|
|
|
cond_true128:
|
2015-03-14 02:20:45 +08:00
|
|
|
%tmp17625 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
|
2011-05-22 15:02:43 +08:00
|
|
|
store i32* %tmp17625, i32** %A
|
2013-11-12 06:00:23 +08:00
|
|
|
%cmp1 = icmp eq i32 %x, %z
|
|
|
|
br i1 %cmp1 , label %bb98.backedge, label %return.loopexit
|
2007-07-27 02:26:51 +08:00
|
|
|
|
2010-11-14 21:30:18 +08:00
|
|
|
bb98.backedge:
|
2007-07-27 02:26:51 +08:00
|
|
|
br label %cond_true116
|
|
|
|
|
2010-11-14 21:30:18 +08:00
|
|
|
cond_true145:
|
2015-03-14 02:20:45 +08:00
|
|
|
%tmp17631 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
|
2011-05-22 15:02:43 +08:00
|
|
|
store i32* %tmp17631, i32** %A
|
2007-07-27 02:26:51 +08:00
|
|
|
br i1 false, label %bb98.backedge, label %return.loopexit
|
|
|
|
|
2010-11-14 21:30:18 +08:00
|
|
|
return.loopexit:
|
2007-07-27 02:26:51 +08:00
|
|
|
br label %return
|
|
|
|
|
2010-11-14 21:30:18 +08:00
|
|
|
return:
|
2007-07-27 02:26:51 +08:00
|
|
|
ret i32 0
|
|
|
|
}
|