blob: 0de2e220c2ccb4e3eefe654d400706679aa83346 [file] [log] [blame]
Ehsan Amiria538b0f2016-08-03 18:17:35 +00001; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s | FileCheck %s
Hal Finkel18607632013-07-18 04:28:21 +00002target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5%struct.s = type { i32, i32 }
6
7declare void @bar(i32*, i32*) #0
8
9define void @goo(%struct.s* byval nocapture readonly %a, i32 signext %n) #0 {
10entry:
11 %0 = zext i32 %n to i64
12 %vla = alloca i32, i64 %0, align 128
13 %vla1 = alloca i32, i64 %0, align 128
David Blaikie79e6c742015-02-27 19:29:02 +000014 %a2 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
David Blaikiea79ac142015-02-27 21:17:42 +000015 %1 = load i32, i32* %a2, align 4
Manman Ren1047fe42013-09-30 18:17:35 +000016 store i32 %1, i32* %vla1, align 128
David Blaikie79e6c742015-02-27 19:29:02 +000017 %b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
David Blaikiea79ac142015-02-27 21:17:42 +000018 %2 = load i32, i32* %b, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000019 %arrayidx3 = getelementptr inbounds i32, i32* %vla1, i64 1
Manman Ren1047fe42013-09-30 18:17:35 +000020 store i32 %2, i32* %arrayidx3, align 4
Hal Finkel18607632013-07-18 04:28:21 +000021 call void @bar(i32* %vla1, i32* %vla) #0
22 ret void
23
24; CHECK-LABEL: @goo
25
26; CHECK-DAG: li [[REG1:[0-9]+]], -128
27; CHECK-DAG: neg [[REG2:[0-9]+]],
Matthias Braunfdc4c6b2016-08-19 03:03:24 +000028; CHECK: and [[REG1]], [[REG2]], [[REG1]]
29; CHECK: stdux {{[0-9]+}}, 1, [[REG1]]
Hal Finkel18607632013-07-18 04:28:21 +000030
31; CHECK: blr
32
33}
34
35attributes #0 = { nounwind }