blob: 21131657820f0863c89188e0d84dfa4c299ed979 [file] [log] [blame]
Tim Northover00ed9962014-03-29 10:18:08 +00001; RUN: llc -march=arm64 -o - %s | FileCheck %s
2
3; ARM64ISelLowering.cpp was creating a new (floating-point) load for efficiency
4; but not updating chain-successors of the old one. As a result, the two memory
5; operations in this function both ended up direct successors to the EntryToken
6; and could be reordered.
7
8@var = global i32 0, align 4
9
10define float @foo() {
11; CHECK-LABEL: foo:
12 ; Load must come before we clobber @var
13; CHECK: adrp x[[VARBASE:[0-9]+]], {{_?var}}
14; CHECK: ldr [[SREG:s[0-9]+]], [x[[VARBASE]],
15; CHECK: str wzr, [x[[VARBASE]],
16
David Blaikiea79ac142015-02-27 21:17:42 +000017 %val = load i32, i32* @var, align 4
Tim Northover00ed9962014-03-29 10:18:08 +000018 store i32 0, i32* @var, align 4
19
20 %fltval = sitofp i32 %val to float
21 ret float %fltval
22}