diff options
| author | Tilmann Scheller <t.scheller@samsung.com> | 2014-05-26 09:37:19 +0000 |
|---|---|---|
| committer | Tilmann Scheller <t.scheller@samsung.com> | 2014-05-26 09:37:19 +0000 |
| commit | 2d746bcda3e4dfb0fa24132eed7cce36bfb3f7c0 (patch) | |
| tree | c62ae52bd420cb1a3246001e55a34428cb2512f1 /llvm/test/CodeGen | |
| parent | 115aa160e68eea810c65aede9d48435b42f26644 (diff) | |
| download | bcm5719-llvm-2d746bcda3e4dfb0fa24132eed7cce36bfb3f7c0.tar.gz bcm5719-llvm-2d746bcda3e4dfb0fa24132eed7cce36bfb3f7c0.zip | |
[AArch64] Add a regression test for the load store optimizer.
We have a couple of regression tests for load/store pairing, but (to my knowledge) there are no regression tests for the load/store + add/sub folding.
As a first step towards increased test coverage of this area, this commit adds a test for one instance of a load + add to pre-indexed load transformation.
llvm-svn: 209618
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/ldst-opt.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/ldst-opt.ll b/llvm/test/CodeGen/AArch64/ldst-opt.ll new file mode 100644 index 00000000000..79c18cacb8d --- /dev/null +++ b/llvm/test/CodeGen/AArch64/ldst-opt.ll @@ -0,0 +1,31 @@ +; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s + +; This file contains tests for the AArch64 load/store optimizer. + +%struct.A = type { %struct.B, %struct.C } +%struct.B = type { i8*, i8*, i8*, i8* } +%struct.C = type { i32, i32 } + +; Check the following transform: +; +; ldr w1, [x0, #32] +; ... +; add x0, x0, #32 +; -> +; ldr w1, [x0, #32]! + +define void @foo(%struct.A* %ptr) nounwind { +; CHECK-LABEL: foo +; CHECK: ldr w{{[0-9]+}}, [x{{[0-9]+}}, #32]! +entry: + %a = getelementptr inbounds %struct.A* %ptr, i64 0, i32 1, i32 0 + %add = load i32* %a, align 4 + br label %bar +bar: + %c = getelementptr inbounds %struct.A* %ptr, i64 0, i32 1 + tail call void @bar(%struct.C* %c, i32 %add) + ret void +} + +declare void @bar(%struct.C*, i32) + |

