llvm.org GIT mirror llvm / 92ae901
Make testcase legal LLVM git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3201 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 18 years ago
2 changed file(s) with 22 addition(s) and 30 deletion(s). Raw diff Collapse all Expand all
8787 ; 1. can be folded
8888 ; 2. cannot be folded because result of comparison is used twice
8989 ;
90 void "testbool"(int, int) ; Def %0, %1
91 const int 0 ; Def 2
92 const int -4 ; Def 3
93 begin
94 ;
90 void "testbool"(int %A, int %B) {
9591 br label %Top
9692 Top:
97 add int %0, %1 ; Def 4
98 sub int %4, %3 ; Def 5
99 setle int %5, %2 ; Def 0 - bool plane
100 br bool %0, label %retlbl, label %loop
93 %D = add int %A, %B
94 %E = sub int %D, -4
95 %C = setle int %E, 0
96 br bool %C, label %retlbl, label %loop
10197
10298 loop:
103 add int %0, %1 ; Def 6
104 sub int %4, %3 ; Def 7
105 setle int %7, %2 ; Def 1 - bool
106 not bool %1 ; Def 2 - bool. first use of bool %1
107 br bool %1, label %loop, label %Top ; second use of bool %1
99 %F = add int %A, %B
100 %G = sub int %D, -4
101 %D = setle int %G, 0
102 %E = not bool %D
103 br bool %E, label %loop, label %Top
108104
109105 retlbl:
110106 ret void
150146 %cast117 = cast int %reg118 to long ;; reg118 will be copied 'cos
151147 %reg159 = add long 1234567, %cast117 ;; cast117 has 2 uses, here
152148 %reg160 = add long 7654321, %cast117 ;; and here.
153 ret void
149 ret int 0
154150 end
8787 ; 1. can be folded
8888 ; 2. cannot be folded because result of comparison is used twice
8989 ;
90 void "testbool"(int, int) ; Def %0, %1
91 const int 0 ; Def 2
92 const int -4 ; Def 3
93 begin
94 ;
90 void "testbool"(int %A, int %B) {
9591 br label %Top
9692 Top:
97 add int %0, %1 ; Def 4
98 sub int %4, %3 ; Def 5
99 setle int %5, %2 ; Def 0 - bool plane
100 br bool %0, label %retlbl, label %loop
93 %D = add int %A, %B
94 %E = sub int %D, -4
95 %C = setle int %E, 0
96 br bool %C, label %retlbl, label %loop
10197
10298 loop:
103 add int %0, %1 ; Def 6
104 sub int %4, %3 ; Def 7
105 setle int %7, %2 ; Def 1 - bool
106 not bool %1 ; Def 2 - bool. first use of bool %1
107 br bool %1, label %loop, label %Top ; second use of bool %1
99 %F = add int %A, %B
100 %G = sub int %D, -4
101 %D = setle int %G, 0
102 %E = not bool %D
103 br bool %E, label %loop, label %Top
108104
109105 retlbl:
110106 ret void
150146 %cast117 = cast int %reg118 to long ;; reg118 will be copied 'cos
151147 %reg159 = add long 1234567, %cast117 ;; cast117 has 2 uses, here
152148 %reg160 = add long 7654321, %cast117 ;; and here.
153 ret void
149 ret int 0
154150 end