blob: eeeafbbfa471cbcf662d6413cd6fc30b0ff38c83 [file] [log] [blame]
Sebastian Pope08d9c72016-12-11 19:39:32 +00001; Test all AArch64 subarches with scheduling models.
2; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=cortex-a57 < %s | FileCheck %s
3; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=cortex-a72 < %s | FileCheck %s
4; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=cortex-a73 < %s | FileCheck %s
5; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=cyclone < %s | FileCheck %s
6; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=exynos-m1 < %s | FileCheck %s
7; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=exynos-m2 < %s | FileCheck %s
Evandro Menezes16d7d812018-01-30 15:40:27 +00008; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=exynos-m3 < %s | FileCheck %s
Sebastian Pope08d9c72016-12-11 19:39:32 +00009; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=kryo < %s | FileCheck %s
Joel Jones28520882017-03-07 19:42:40 +000010; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=thunderx2t99 < %s | FileCheck %s
Sebastian Pope08d9c72016-12-11 19:39:32 +000011
12; Make sure that inst-combine fuses the multiply add in the addressing mode of
13; the load.
14
15; CHECK-LABEL: fun:
16; CHECK-NOT: mul
17; CHECK: madd
18; CHECK-NOT: mul
19
20%class.D = type { %class.basic_string.base, [4 x i8] }
21%class.basic_string.base = type <{ i64, i64, i32 }>
22@a = global %class.D* zeroinitializer, align 8
Daniel Neilson1e687242018-01-19 17:13:12 +000023declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
Sebastian Pope08d9c72016-12-11 19:39:32 +000024define internal void @fun() section ".text.startup" {
25entry:
26 %tmp.i.i = alloca %class.D, align 8
27 %y = bitcast %class.D* %tmp.i.i to i8*
28 br label %loop
29loop:
30 %conv11.i.i = phi i64 [ 0, %entry ], [ %inc.i.i, %loop ]
31 %i = phi i64 [ undef, %entry ], [ %inc.i.i, %loop ]
32 %x = load %class.D*, %class.D** getelementptr inbounds (%class.D*, %class.D** @a, i64 0), align 8
33 %arrayidx.i.i.i = getelementptr inbounds %class.D, %class.D* %x, i64 %conv11.i.i
34 %d = bitcast %class.D* %arrayidx.i.i.i to i8*
Daniel Neilson1e687242018-01-19 17:13:12 +000035 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 nonnull %y, i8* align 8 %d, i64 24, i1 false)
Sebastian Pope08d9c72016-12-11 19:39:32 +000036 %inc.i.i = add i64 %i, 1
37 %cmp.i.i = icmp slt i64 %inc.i.i, 0
38 br i1 %cmp.i.i, label %loop, label %exit
39exit:
40 ret void
41}