2003-12-10 05:42:23 +00:00
|
|
|
; This testcase checks to make sure we can sink values which are only live on
|
|
|
|
; some exits out of the loop, and that we can do so without breaking dominator
|
|
|
|
; info.
|
|
|
|
;
|
2004-08-02 22:31:58 +00:00
|
|
|
; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext add 1 | grep exit2:
|
2003-12-10 05:42:23 +00:00
|
|
|
|
|
|
|
implementation ; Functions:
|
|
|
|
|
|
|
|
int %test(bool %C1, bool %C2, int *%P, int* %Q) {
|
|
|
|
Entry:
|
|
|
|
br label %Loop
|
|
|
|
|
|
|
|
Loop:
|
|
|
|
br bool %C1, label %Cont, label %exit1
|
|
|
|
Cont:
|
|
|
|
%X = load int* %P
|
|
|
|
store int %X, int* %Q
|
|
|
|
%V = add int %X, 1
|
|
|
|
br bool %C2, label %Loop, label %exit2
|
|
|
|
|
|
|
|
exit1:
|
|
|
|
ret int 0
|
|
|
|
exit2:
|
|
|
|
ret int %V
|
|
|
|
}
|