Krzysztof Parzyszek | d391d6f | 2016-10-06 16:18:04 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon < %s | FileCheck %s |
| 2 | ; This testcase crashed, because we propagated a reg:sub into a tied use. |
| 3 | ; The two-address pass rewrote it in a way that generated incorrect code. |
Krzysztof Parzyszek | a72fad9 | 2017-02-10 15:33:13 +0000 | [diff] [blame] | 4 | ; CHECK: r{{[0-9]+}} += lsr(r{{[0-9]+}},#16) |
Krzysztof Parzyszek | d391d6f | 2016-10-06 16:18:04 +0000 | [diff] [blame] | 5 | |
| 6 | target triple = "hexagon" |
| 7 | |
| 8 | define i64 @fred(i64 %x) local_unnamed_addr #0 { |
| 9 | entry: |
| 10 | %t.sroa.0.0.extract.trunc = trunc i64 %x to i32 |
| 11 | %t4.sroa.4.0.extract.shift = lshr i64 %x, 16 |
| 12 | %add11 = add i32 0, %t.sroa.0.0.extract.trunc |
| 13 | %t14.sroa.3.0.extract.trunc = trunc i64 %t4.sroa.4.0.extract.shift to i32 |
| 14 | %t14.sroa.4.0.extract.shift = lshr i64 %x, 24 |
| 15 | %add21 = add i32 %add11, %t14.sroa.3.0.extract.trunc |
| 16 | %t24.sroa.3.0.extract.trunc = trunc i64 %t14.sroa.4.0.extract.shift to i32 |
| 17 | %add31 = add i32 %add21, %t24.sroa.3.0.extract.trunc |
| 18 | %conv32.mask = and i32 %add31, 255 |
| 19 | %conv33 = zext i32 %conv32.mask to i64 |
| 20 | ret i64 %conv33 |
| 21 | } |
| 22 | |
| 23 | attributes #0 = { norecurse nounwind readnone } |