Hal Finkel | 42c83f1 | 2016-09-07 07:36:11 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s | FileCheck %s |
| 2 | target datalayout = "e-m:e-i64:64-n32:64" |
| 3 | target triple = "powerpc64le-unknown-linux-gnu" |
| 4 | |
| 5 | %struct.S0 = type <{ i32, [5 x i8] }> |
| 6 | |
| 7 | ; Function Attrs: norecurse nounwind readnone |
| 8 | define signext i32 @foo([2 x i64] %a.coerce) local_unnamed_addr #0 { |
| 9 | entry: |
| 10 | %a = alloca %struct.S0, align 8 |
| 11 | %a.coerce.fca.0.extract = extractvalue [2 x i64] %a.coerce, 0 |
| 12 | %a.coerce.fca.1.extract = extractvalue [2 x i64] %a.coerce, 1 |
| 13 | %a.0.a.0..sroa_cast = bitcast %struct.S0* %a to i64* |
| 14 | store i64 %a.coerce.fca.0.extract, i64* %a.0.a.0..sroa_cast, align 8 |
| 15 | %tmp.sroa.2.0.extract.trunc = trunc i64 %a.coerce.fca.1.extract to i8 |
| 16 | %a.8.a.8..sroa_idx = getelementptr inbounds %struct.S0, %struct.S0* %a, i64 0, i32 1, i64 4 |
| 17 | store i8 %tmp.sroa.2.0.extract.trunc, i8* %a.8.a.8..sroa_idx, align 8 |
| 18 | %a.4.a.4..sroa_idx = getelementptr inbounds %struct.S0, %struct.S0* %a, i64 0, i32 1 |
| 19 | %a.4.a.4..sroa_cast = bitcast [5 x i8]* %a.4.a.4..sroa_idx to i40* |
| 20 | %a.4.a.4.bf.load = load i40, i40* %a.4.a.4..sroa_cast, align 4 |
| 21 | %bf.lshr = lshr i40 %a.4.a.4.bf.load, 31 |
| 22 | %bf.lshr.tr = trunc i40 %bf.lshr to i32 |
| 23 | %bf.cast = and i32 %bf.lshr.tr, 127 |
| 24 | ret i32 %bf.cast |
| 25 | |
| 26 | ; CHECK-LABEL: @foo |
Nirav Dave | 07acc99 | 2018-10-10 14:15:52 +0000 | [diff] [blame] | 27 | ; FIXME: We don't need to do these stores at all. |
Hal Finkel | 42c83f1 | 2016-09-07 07:36:11 +0000 | [diff] [blame] | 28 | ; CHECK-DAG: std 3, -24(1) |
| 29 | ; CHECK-DAG: stb 4, -16(1) |
Hal Finkel | 42c83f1 | 2016-09-07 07:36:11 +0000 | [diff] [blame] | 30 | ; CHECK-DAG: lwz [[REG2:[0-9]+]], -20(1) |
Hiroshi Inoue | 9552dd1 | 2018-10-12 14:02:20 +0000 | [diff] [blame] | 31 | ; CHECK-DAG: rlwinm 3, [[REG2]], 1, 31, 31 |
| 32 | ; CHECK: rlwimi 3, 4, 1, 25, 30 |
Hal Finkel | 42c83f1 | 2016-09-07 07:36:11 +0000 | [diff] [blame] | 33 | ; CHECK: blr |
| 34 | } |
| 35 | |
| 36 | attributes #0 = { nounwind "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"="ppc64le" } |
| 37 | |