• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN:  llc -O3 -code-model=default -mtriple=armv7l-unknown-linux-gnueabihf -mcpu=generic %s -o - | FileCheck %s
2; Check that we respect the existing chain between loads and stores when we
3; legalize unaligned loads.
4; Test case from PR24669.
5
6; Make sure the loads happen before the stores.
7; CHECK-LABEL: get_set_complex:
8; CHECK-NOT: str
9; CHECK: ldr
10; CHECK-NOT: str
11; CHECK: ldr
12; CHECK: str
13; CHECK: bx
14define i32 @get_set_complex({ float, float }* noalias nocapture %retptr,
15                            { i8*, i32 }** noalias nocapture readnone %excinfo,
16                            i8* noalias nocapture readnone %env,
17                            [38 x i8]* nocapture %arg.rec,
18                            float %arg.val.0, float %arg.val.1)
19{
20entry:
21  %inserted.real = insertvalue { float, float } undef, float %arg.val.0, 0
22  %inserted.imag = insertvalue { float, float } %inserted.real, float %arg.val.1, 1
23  %.15 = getelementptr inbounds [38 x i8], [38 x i8]* %arg.rec, i32 0, i32 10
24  %.16 = bitcast i8* %.15 to { float, float }*
25  %.17 = bitcast i8* %.15 to float*
26  %.18 = load float, float* %.17, align 1
27  %.19 = getelementptr inbounds [38 x i8], [38 x i8]* %arg.rec, i32 0, i32 14
28  %tmp = bitcast i8* %.19 to float*
29  %.20 = load float, float* %tmp, align 1
30  %inserted.real.1 = insertvalue { float, float } undef, float %.18, 0
31  %inserted.imag.1 = insertvalue { float, float } %inserted.real.1, float %.20, 1
32  store { float, float } %inserted.imag, { float, float }* %.16, align 1
33  store { float, float } %inserted.imag.1, { float, float }* %retptr, align 4
34  ret i32 0
35}
36