| 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 |
store i64 %a.coerce.fca.0.extract, ptr %a, align 8 |
| 14 |
%tmp.sroa.2.0.extract.trunc = trunc i64 %a.coerce.fca.1.extract to i8 |
| 15 |
%a.8.a.8..sroa_idx = getelementptr inbounds %struct.S0, ptr %a, i64 0, i32 1, i64 4 |
| 16 |
store i8 %tmp.sroa.2.0.extract.trunc, ptr %a.8.a.8..sroa_idx, align 8 |
| 17 |
%a.4.a.4..sroa_idx = getelementptr inbounds %struct.S0, ptr %a, i64 0, i32 1 |
| 18 |
%a.4.a.4.bf.load = load i40, ptr %a.4.a.4..sroa_idx, align 4 |
| 19 |
%bf.lshr = lshr i40 %a.4.a.4.bf.load, 31 |
| 20 |
%bf.lshr.tr = trunc i40 %bf.lshr to i32 |
| 21 |
%bf.cast = and i32 %bf.lshr.tr, 127 |
| 22 |
ret i32 %bf.cast |
| 23 |
|
| 24 |
; CHECK-LABEL: @foo |
| 25 |
; FIXME: We don't need to do these stores at all. |
| 26 |
; CHECK-DAG: std 3, -24(1) |
| 27 |
; CHECK-DAG: stb 4, -16(1) |
| 28 |
; CHECK-DAG: lwz [[REG2:[0-9]+]], -20(1) |
| 29 |
; CHECK-DAG: rlwinm 3, [[REG2]], 1, 31, 31 |
| 30 |
; CHECK: rlwimi 3, 4, 1, 25, 30 |
| 31 |
; CHECK: blr |
| 32 |
} |
| 33 |
|
| 34 |
attributes #0 = { nounwind "frame-pointer"="all" "target-cpu"="ppc64le" } |
| 35 |
|