forked from OSchip/llvm-project
parent
72272a70b8
commit
2a4080c140
|
@ -1,25 +0,0 @@
|
|||
; This testcase exposed a problem with the loop identification pass (LoopInfo).
|
||||
; Basically, it was incorrectly calculating the loop nesting information.
|
||||
;
|
||||
; RUN: llvm-as < %s | opt -loopsimplify
|
||||
|
||||
implementation ; Functions:
|
||||
|
||||
int %yylex() { ; No predecessors!
|
||||
br label %loopentry.0
|
||||
|
||||
loopentry.0: ; preds = %0, %yy_find_action, %else.4
|
||||
br label %loopexit.2
|
||||
|
||||
loopexit.2: ; preds = %loopentry.0, %else.4, %loopexit.2
|
||||
br bool false, label %loopexit.2, label %else.4
|
||||
|
||||
yy_find_action: ; preds = %loopexit.2, %else.4
|
||||
br label %else.4
|
||||
|
||||
else.4: ; preds = %yy_find_action
|
||||
switch uint 0, label %loopexit.2 [
|
||||
uint 2, label %yy_find_action
|
||||
uint 0, label %loopentry.0
|
||||
]
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
; This (complex) testcase causes an assertion failure because a preheader is
|
||||
; inserted for the "fail" loop, but the exit block of a loop is not updated
|
||||
; to be the preheader instead of the exit loop itself.
|
||||
|
||||
; RUN: llvm-as < %s | opt -loopsimplify
|
||||
|
||||
int %re_match_2() {
|
||||
br label %loopentry.1
|
||||
|
||||
loopentry.1: ; preds = %then.6, %endif.7, %loopexit.20, %endif.83
|
||||
br label %shortcirc_done.36
|
||||
|
||||
shortcirc_done.36: ; preds = %label.13, %shortcirc_next.36
|
||||
br bool false, label %fail, label %endif.40
|
||||
|
||||
endif.40: ; preds = %shortcirc_done.36
|
||||
br label %loopexit.20
|
||||
|
||||
loopentry.20: ; preds = %shortcirc_done.40, %endif.46
|
||||
br label %loopexit.20
|
||||
|
||||
loopexit.20: ; preds = %loopentry.20
|
||||
br label %loopentry.21
|
||||
|
||||
loopentry.21: ; preds = %loopexit.20, %no_exit.19
|
||||
br bool false, label %no_exit.19, label %loopexit.21
|
||||
|
||||
no_exit.19: ; preds = %loopentry.21
|
||||
br bool false, label %fail, label %loopentry.21
|
||||
|
||||
loopexit.21: ; preds = %loopentry.21
|
||||
br label %endif.45
|
||||
|
||||
endif.45: ; preds = %loopexit.21
|
||||
br label %cond_true.15
|
||||
|
||||
cond_true.15: ; preds = %endif.45
|
||||
br bool false, label %fail, label %endif.46
|
||||
|
||||
endif.46: ; preds = %cond_true.15
|
||||
br label %loopentry.20
|
||||
|
||||
fail: ; preds = %shortcirc_done.36, %loopexit.37, %cond_true.15, %no_exit.19
|
||||
br label %then.80
|
||||
|
||||
then.80: ; preds = %fail
|
||||
br label %endif.81
|
||||
|
||||
endif.81: ; preds = %then.80
|
||||
br label %loopexit.37
|
||||
|
||||
loopexit.37: ; preds = %endif.81
|
||||
br bool false, label %fail, label %endif.82
|
||||
|
||||
endif.82: ; preds = %loopexit.37
|
||||
br label %loopentry.1
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
; RUN: llvm-as < %s | opt -tailduplicate -instcombine -simplifycfg -licm -disable-output
|
||||
|
||||
target endian = little
|
||||
target pointersize = 32
|
||||
%yy_base = external global [787 x short] ; <[787 x short]*> [#uses=1]
|
||||
%yy_state_ptr = external global int* ; <int**> [#uses=3]
|
||||
%yy_state_buf = external global [16386 x int] ; <[16386 x int]*> [#uses=1]
|
||||
%yy_lp = external global int ; <int*> [#uses=1]
|
||||
|
||||
implementation ; Functions:
|
||||
|
||||
int %_yylex() { ; No predecessors!
|
||||
br label %loopentry.0
|
||||
|
||||
loopentry.0: ; preds = %0, %else.26
|
||||
store int* getelementptr ([16386 x int]* %yy_state_buf, long 0, long 0), int** %yy_state_ptr
|
||||
%tmp.35 = load int** %yy_state_ptr ; <int*> [#uses=2]
|
||||
%inc.0 = getelementptr int* %tmp.35, long 1 ; <int*> [#uses=1]
|
||||
store int* %inc.0, int** %yy_state_ptr
|
||||
%tmp.36 = load int* null ; <int> [#uses=1]
|
||||
store int %tmp.36, int* %tmp.35
|
||||
br label %loopexit.2
|
||||
|
||||
loopexit.2: ; preds = %loopentry.0, %else.26, %loopexit.2
|
||||
store sbyte* null, sbyte** null
|
||||
%tmp.91 = load int* null ; <int> [#uses=1]
|
||||
%tmp.92 = cast int %tmp.91 to long ; <long> [#uses=1]
|
||||
%tmp.93 = getelementptr [787 x short]* %yy_base, long 0, long %tmp.92 ; <short*> [#uses=1]
|
||||
%tmp.94 = load short* %tmp.93 ; <short> [#uses=1]
|
||||
%tmp.95 = setne short %tmp.94, 4394 ; <bool> [#uses=1]
|
||||
br bool %tmp.95, label %loopexit.2, label %yy_find_action
|
||||
|
||||
yy_find_action: ; preds = %loopexit.2, %else.26
|
||||
br label %loopentry.3
|
||||
|
||||
loopentry.3: ; preds = %yy_find_action, %shortcirc_done.0, %then.9
|
||||
%tmp.105 = load int* %yy_lp ; <int> [#uses=1]
|
||||
%tmp.106 = setne int %tmp.105, 0 ; <bool> [#uses=1]
|
||||
br bool %tmp.106, label %shortcirc_next.0, label %shortcirc_done.0
|
||||
|
||||
shortcirc_next.0: ; preds = %loopentry.3
|
||||
%tmp.114 = load short* null ; <short> [#uses=1]
|
||||
%tmp.115 = cast short %tmp.114 to int ; <int> [#uses=1]
|
||||
%tmp.116 = setlt int 0, %tmp.115 ; <bool> [#uses=1]
|
||||
br label %shortcirc_done.0
|
||||
|
||||
shortcirc_done.0: ; preds = %loopentry.3, %shortcirc_next.0
|
||||
%shortcirc_val.0 = phi bool [ false, %loopentry.3 ], [ %tmp.116, %shortcirc_next.0 ] ; <bool> [#uses=1]
|
||||
br bool %shortcirc_val.0, label %else.0, label %loopentry.3
|
||||
|
||||
else.0: ; preds = %shortcirc_done.0
|
||||
%tmp.144 = load int* null ; <int> [#uses=1]
|
||||
%tmp.145 = and int %tmp.144, 8192 ; <int> [#uses=1]
|
||||
%tmp.146 = setne int %tmp.145, 0 ; <bool> [#uses=1]
|
||||
br bool %tmp.146, label %then.9, label %else.26
|
||||
|
||||
then.9: ; preds = %else.0
|
||||
br label %loopentry.3
|
||||
|
||||
else.26: ; preds = %else.1
|
||||
switch uint 0, label %loopentry.0 [
|
||||
uint 2, label %yy_find_action
|
||||
uint 0, label %loopexit.2
|
||||
]
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
; RUN: llvm-as < %s | opt -loopsimplify
|
||||
|
||||
implementation
|
||||
|
||||
; This function should get a preheader inserted before BB3, that is jumped
|
||||
; to by BB1 & BB2
|
||||
;
|
||||
void "test"()
|
||||
begin
|
||||
br bool true, label %BB1, label %BB2
|
||||
BB1: br label %BB3
|
||||
BB2: br label %BB3
|
||||
|
||||
|
||||
BB3:
|
||||
br label %BB3
|
||||
end
|
|
@ -1,17 +0,0 @@
|
|||
; RUN: llvm-as < %s | opt -loopsimplify
|
||||
|
||||
void %foo(bool %C) {
|
||||
br bool %C, label %T, label %F
|
||||
T:
|
||||
br label %Loop
|
||||
F:
|
||||
br label %Loop
|
||||
|
||||
Loop: ; Two backedges, two incoming edges.
|
||||
%Val = phi int [0, %T], [1, %F], [2, %Loop], [3, %L2]
|
||||
|
||||
br bool %C, label %Loop, label %L2
|
||||
|
||||
L2:
|
||||
br label %Loop
|
||||
}
|
Loading…
Reference in New Issue