Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 1 | ; LoopInfo is incorrectly calculating loop nesting! In this case it doesn't |
| 2 | ; figure out that loop "Inner" should be nested inside of leep "LoopHeader", |
| 3 | ; and instead nests it just inside loop "Top" |
| 4 | ; |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 5 | ; RUN: llvm-as < %s | opt -analyze -loops | \ |
Reid Spencer | a9338b6 | 2007-04-15 10:26:05 +0000 | [diff] [blame] | 6 | ; RUN: grep { Loop Containing:\[ \]*%Inner} |
Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 7 | ; |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 8 | define void @test() { |
| 9 | br label %Top |
Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 10 | |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 11 | Top: ; preds = %Out, %0 |
| 12 | br label %LoopHeader |
Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 13 | |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 14 | Next: ; preds = %LoopHeader |
| 15 | br i1 false, label %Inner, label %Out |
Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 16 | |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 17 | Inner: ; preds = %Inner, %Next |
| 18 | br i1 false, label %Inner, label %LoopHeader |
Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 19 | |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 20 | LoopHeader: ; preds = %Inner, %Top |
| 21 | br label %Next |
Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 22 | |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 23 | Out: ; preds = %Next |
| 24 | br i1 false, label %Top, label %Done |
| 25 | |
| 26 | Done: ; preds = %Out |
| 27 | ret void |
Chris Lattner | e9d0070 | 2003-02-20 00:09:26 +0000 | [diff] [blame] | 28 | } |
Tanya Lattner | 2ad38be | 2008-02-19 01:44:26 +0000 | [diff] [blame^] | 29 | |