2019-01-25 07:11:25 +08:00
|
|
|
; RUN: llc -mtriple=aarch64-linux-gnu -stop-after=irtranslator -enable-cse-in-irtranslator=1 -global-isel -verify-machineinstrs %s -o - 2>&1 | FileCheck %s
|
2019-01-16 08:40:37 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_split_struct
|
|
|
|
; CHECK: [[ADDR:%[0-9]+]]:_(p0) = COPY $x0
|
|
|
|
; CHECK: [[LO:%[0-9]+]]:_(s64) = G_LOAD %0(p0) :: (load 8 from %ir.ptr)
|
|
|
|
; CHECK: [[CST:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
|
[globalisel] Rename G_GEP to G_PTR_ADD
Summary:
G_GEP is rather poorly named. It's a simple pointer+scalar addition and
doesn't support any of the complexities of getelementptr. I therefore
propose that we rename it. There's a G_PTR_MASK so let's follow that
convention and go with G_PTR_ADD
Reviewers: volkan, aditya_nandakumar, bogner, rovka, arsenm
Subscribers: sdardis, jvesely, wdng, nhaehnle, hiraditya, jrtc27, atanasyan, arphaman, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69734
2019-11-02 04:18:00 +08:00
|
|
|
; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_PTR_ADD [[ADDR]], [[CST]](s64)
|
2019-01-16 08:40:37 +08:00
|
|
|
; CHECK: [[HI:%[0-9]+]]:_(s64) = G_LOAD [[GEP]](p0) :: (load 8 from %ir.ptr + 8)
|
|
|
|
|
|
|
|
; CHECK: [[SP:%[0-9]+]]:_(p0) = COPY $sp
|
|
|
|
; CHECK: [[CST2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
|
[globalisel] Rename G_GEP to G_PTR_ADD
Summary:
G_GEP is rather poorly named. It's a simple pointer+scalar addition and
doesn't support any of the complexities of getelementptr. I therefore
propose that we rename it. There's a G_PTR_MASK so let's follow that
convention and go with G_PTR_ADD
Reviewers: volkan, aditya_nandakumar, bogner, rovka, arsenm
Subscribers: sdardis, jvesely, wdng, nhaehnle, hiraditya, jrtc27, atanasyan, arphaman, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69734
2019-11-02 04:18:00 +08:00
|
|
|
; CHECK: [[GEP2:%[0-9]+]]:_(p0) = G_PTR_ADD [[SP]], [[CST2]](s64)
|
2019-06-27 17:18:03 +08:00
|
|
|
; CHECK: G_STORE [[LO]](s64), [[GEP2]](p0) :: (store 8 into stack, align 1)
|
2019-01-16 08:40:37 +08:00
|
|
|
; CHECK: [[SP:%[0-9]+]]:_(p0) = COPY $sp
|
|
|
|
; CHECK: [[CST3:%[0-9]+]]:_(s64) = COPY [[CST]]
|
[globalisel] Rename G_GEP to G_PTR_ADD
Summary:
G_GEP is rather poorly named. It's a simple pointer+scalar addition and
doesn't support any of the complexities of getelementptr. I therefore
propose that we rename it. There's a G_PTR_MASK so let's follow that
convention and go with G_PTR_ADD
Reviewers: volkan, aditya_nandakumar, bogner, rovka, arsenm
Subscribers: sdardis, jvesely, wdng, nhaehnle, hiraditya, jrtc27, atanasyan, arphaman, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69734
2019-11-02 04:18:00 +08:00
|
|
|
; CHECK: [[GEP3:%[0-9]+]]:_(p0) = G_PTR_ADD [[SP]], [[CST3]](s64)
|
2019-06-27 17:18:03 +08:00
|
|
|
; CHECK: G_STORE [[HI]](s64), [[GEP3]](p0) :: (store 8 into stack + 8, align 1)
|
2019-01-16 08:40:37 +08:00
|
|
|
define void @test_split_struct([2 x i64]* %ptr) {
|
|
|
|
%struct = load [2 x i64], [2 x i64]* %ptr
|
|
|
|
call void @take_split_struct([2 x i64]* null, i64 1, i64 2, i64 3,
|
|
|
|
i64 4, i64 5, i64 6,
|
|
|
|
[2 x i64] %struct)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @take_split_struct([2 x i64]* %ptr, i64, i64, i64,
|
|
|
|
i64, i64, i64,
|
|
|
|
[2 x i64] %in) ;
|