xref: /llvm-project/llvm/test/CodeGen/AArch64/sdag-store-merging-bug.ll (revision 5ddce70ef0e5a641d7fea95e31fc5e2439cb98cb)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -o - %s -mtriple aarch64-- -mattr +slow-misaligned-128store | FileCheck %s
3; Checks for a bug where selection dag store merging would construct wrong
4; indices when extracting values from vectors, resulting in an invalid
5; lane duplication in this case.
6; The only way I could trigger stores with mismatching types getting merged was
7; via the aarch64 slow-misaligned-128store code splitting stores earlier.
8
9; aarch64 feature slow-misaligned-128store splits the following store.
10; store merging immediately merges it back together (but used to get the
11; merging wrong), this is the only way I was able to reproduce the bug...
12
13define void @func(ptr %sptr, ptr %dptr) {
14; CHECK-LABEL: func:
15; CHECK:       // %bb.0:
16; CHECK-NEXT:    ldr q0, [x0]
17; CHECK-NEXT:    str q0, [x1]
18; CHECK-NEXT:    ret
19  %load = load <2 x double>, ptr %sptr, align 8
20  store <2 x double> %load, ptr %dptr, align 4
21  ret void
22}
23