Krzysztof Parzyszek | d91a9e2 | 2018-08-02 22:17:53 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s |
Krzysztof Parzyszek | 4773f64 | 2016-04-26 18:36:34 +0000 | [diff] [blame] | 2 | ; REQUIRES: asserts |
| 3 | |
| 4 | ; When tail-duplicating a block with PHI nodes that use subregisters, the |
| 5 | ; subregisters were dropped by the tail duplicator, resulting in invalid |
| 6 | ; COPY instructions being generated. |
| 7 | |
Sanjay Patel | 014c000 | 2018-02-12 21:37:27 +0000 | [diff] [blame] | 8 | ; CHECK: = asl(r{{[0-9]+}}:{{[0-9]+}},#15) |
Krzysztof Parzyszek | 4773f64 | 2016-04-26 18:36:34 +0000 | [diff] [blame] | 9 | |
| 10 | target triple = "hexagon" |
| 11 | |
| 12 | %struct.0 = type { i64, i16 } |
| 13 | %struct.1 = type { i64, i64 } |
| 14 | |
| 15 | declare hidden fastcc void @foo(%struct.0* noalias nocapture, i8 signext, i8 zeroext, i32, i64, i64) unnamed_addr #0 |
| 16 | |
| 17 | define void @fred(%struct.0* noalias nocapture sret %agg.result, %struct.1* byval nocapture readonly align 8 %a) #1 { |
| 18 | entry: |
| 19 | %0 = load i64, i64* undef, align 8 |
| 20 | switch i32 undef, label %if.else [ |
| 21 | i32 32767, label %if.then |
| 22 | i32 0, label %if.then7 |
| 23 | ] |
| 24 | |
| 25 | if.then: ; preds = %entry |
| 26 | ret void |
| 27 | |
| 28 | if.then7: ; preds = %entry |
| 29 | br i1 undef, label %if.then.i, label %if.else16.i |
| 30 | |
| 31 | if.then.i: ; preds = %if.then7 |
| 32 | br i1 undef, label %if.then5.i, label %if.else.i |
| 33 | |
| 34 | if.then5.i: ; preds = %if.then.i |
| 35 | %shl.i21 = shl i64 %0, 0 |
| 36 | br label %if.end.i |
| 37 | |
| 38 | if.else.i: ; preds = %if.then.i |
Sanjay Patel | 014c000 | 2018-02-12 21:37:27 +0000 | [diff] [blame] | 39 | %shl12.i = shl i64 %0, 7 |
Krzysztof Parzyszek | 4773f64 | 2016-04-26 18:36:34 +0000 | [diff] [blame] | 40 | br label %if.end.i |
| 41 | |
| 42 | if.end.i: ; preds = %if.else.i, %if.then5.i |
| 43 | %aSig0.0 = phi i64 [ undef, %if.then5.i ], [ %shl12.i, %if.else.i ] |
| 44 | %storemerge43.i = phi i64 [ %shl.i21, %if.then5.i ], [ 0, %if.else.i ] |
Sanjay Patel | 014c000 | 2018-02-12 21:37:27 +0000 | [diff] [blame] | 45 | %sub15.i = sub nsw i32 -63, 8 |
Krzysztof Parzyszek | 4773f64 | 2016-04-26 18:36:34 +0000 | [diff] [blame] | 46 | br label %if.end13 |
| 47 | |
| 48 | if.else16.i: ; preds = %if.then7 |
| 49 | br label %if.end13 |
| 50 | |
| 51 | if.else: ; preds = %entry |
Sanjay Patel | 014c000 | 2018-02-12 21:37:27 +0000 | [diff] [blame] | 52 | %or12 = or i64 9, 281474976710656 |
Krzysztof Parzyszek | 4773f64 | 2016-04-26 18:36:34 +0000 | [diff] [blame] | 53 | br label %if.end13 |
| 54 | |
| 55 | if.end13: ; preds = %if.else, %if.else16.i, %if.end.i |
| 56 | %aSig1.1 = phi i64 [ %0, %if.else ], [ %storemerge43.i, %if.end.i ], [ undef, %if.else16.i ] |
| 57 | %aSig0.2 = phi i64 [ %or12, %if.else ], [ %aSig0.0, %if.end.i ], [ undef, %if.else16.i ] |
| 58 | %aExp.0 = phi i32 [ undef, %if.else ], [ %sub15.i, %if.end.i ], [ undef, %if.else16.i ] |
| 59 | %shl2.i = shl i64 %aSig0.2, 15 |
| 60 | %shr.i = lshr i64 %aSig1.1, 49 |
| 61 | %or.i = or i64 %shl2.i, %shr.i |
| 62 | tail call fastcc void @foo(%struct.0* noalias %agg.result, i8 signext 80, i8 zeroext undef, i32 %aExp.0, i64 %or.i, i64 undef) |
| 63 | unreachable |
| 64 | } |
| 65 | |
| 66 | attributes #0 = { norecurse nounwind } |
| 67 | attributes #1 = { nounwind } |