blob: 2cce3f12c1d40b4fb1bd5438286e2d5fc214c625 [file] [log] [blame]
Tobias Edler von Kochb51460c2015-12-16 17:29:37 +00001; RUN: llc -march=hexagon < %s | FileCheck %s
2; CHECK: __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes
3
4target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
5target triple = "hexagon-unknown-linux-gnu"
6
7%struct.e = type { i8, i8, [2 x i8] }
8%struct.s = type { i8* }
9%struct.o = type { %struct.n }
10%struct.n = type { [2 x %struct.l] }
11%struct.l = type { %struct.e, %struct.d, %struct.e }
12%struct.d = type <{ i8, i8, i8, i8, [2 x i8], [2 x i8] }>
13
14@y = global { <{ { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e }, { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e } }> } { <{ { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e }, { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e } }> <{ { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e } { %struct.e { i8 3, i8 0, [2 x i8] undef }, { i8, i8, i8, [5 x i8] } { i8 -47, i8 2, i8 0, [5 x i8] undef }, %struct.e { i8 3, i8 0, [2 x i8] undef } }, { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e } { %struct.e { i8 3, i8 0, [2 x i8] undef }, { i8, i8, i8, [5 x i8] } { i8 -47, i8 2, i8 0, [5 x i8] undef }, %struct.e { i8 3, i8 0, [2 x i8] undef } } }> }, align 4
15@t = common global %struct.s zeroinitializer, align 4
16@q = internal global %struct.o* null, align 4
17
18define void @foo() nounwind {
19entry:
20 %0 = load i8*, i8** getelementptr inbounds (%struct.s, %struct.s* @t, i32 0, i32 0), align 4
21 %1 = bitcast i8* %0 to %struct.o*
22 store %struct.o* %1, %struct.o** @q, align 4
23 %2 = load %struct.o*, %struct.o** @q, align 4
24 %p = getelementptr inbounds %struct.o, %struct.o* %2, i32 0, i32 0
25 %m = getelementptr inbounds %struct.n, %struct.n* %p, i32 0, i32 0
26 %arraydecay = getelementptr inbounds [2 x %struct.l], [2 x %struct.l]* %m, i32 0, i32 0
27 %3 = bitcast %struct.l* %arraydecay to i8*
Daniel Neilson1e687242018-01-19 17:13:12 +000028 call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %3, i8* align 4 getelementptr inbounds ({ <{ { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e }, { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e } }> }, { <{ { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e }, { %struct.e, { i8, i8, i8, [5 x i8] }, %struct.e } }> }* @y, i32 0, i32 0, i32 0, i32 0, i32 0), i32 32, i1 false)
Tobias Edler von Kochb51460c2015-12-16 17:29:37 +000029 ret void
30}
31
Daniel Neilson1e687242018-01-19 17:13:12 +000032declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind