Heejin Ahn | 777d01c | 2019-01-03 23:10:11 +0000 | [diff] [blame^] | 1 | ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-block-placement -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s |
| 2 | |
| 3 | target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" |
| 4 | target triple = "wasm32-unknown-unknown" |
| 5 | |
| 6 | |
| 7 | ; Test an interesting pattern of nested irreducibility. |
| 8 | ; Just check we resolve all the irreducibility here (if not we'd crash). |
| 9 | |
| 10 | ; CHECK-LABEL: tre_parse: |
| 11 | |
| 12 | define void @tre_parse() { |
| 13 | entry: |
| 14 | br label %for.cond.outer |
| 15 | |
| 16 | for.cond.outer: ; preds = %do.body14, %entry |
| 17 | br label %for.cond |
| 18 | |
| 19 | for.cond: ; preds = %for.cond.backedge, %for.cond.outer |
| 20 | %nbranch.0 = phi i32* [ null, %for.cond.outer ], [ %call188, %for.cond.backedge ] |
| 21 | switch i8 undef, label %if.else [ |
| 22 | i8 40, label %do.body14 |
| 23 | i8 41, label %if.then63 |
| 24 | ] |
| 25 | |
| 26 | do.body14: ; preds = %for.cond |
| 27 | br label %for.cond.outer |
| 28 | |
| 29 | if.then63: ; preds = %for.cond |
| 30 | unreachable |
| 31 | |
| 32 | if.else: ; preds = %for.cond |
| 33 | switch i8 undef, label %if.then84 [ |
| 34 | i8 92, label %if.end101 |
| 35 | i8 42, label %if.end101 |
| 36 | ] |
| 37 | |
| 38 | if.then84: ; preds = %if.else |
| 39 | switch i8 undef, label %cleanup.thread [ |
| 40 | i8 43, label %if.end101 |
| 41 | i8 63, label %if.end101 |
| 42 | i8 123, label %if.end101 |
| 43 | ] |
| 44 | |
| 45 | if.end101: ; preds = %if.then84, %if.then84, %if.then84, %if.else, %if.else |
| 46 | unreachable |
| 47 | |
| 48 | cleanup.thread: ; preds = %if.then84 |
| 49 | %call188 = tail call i32* undef(i32* %nbranch.0) |
| 50 | switch i8 undef, label %for.cond.backedge [ |
| 51 | i8 92, label %land.lhs.true208 |
| 52 | i8 0, label %if.else252 |
| 53 | ] |
| 54 | |
| 55 | land.lhs.true208: ; preds = %cleanup.thread |
| 56 | unreachable |
| 57 | |
| 58 | for.cond.backedge: ; preds = %cleanup.thread |
| 59 | br label %for.cond |
| 60 | |
| 61 | if.else252: ; preds = %cleanup.thread |
| 62 | unreachable |
| 63 | } |