diff options
| author | Juergen Ributzka <juergen@apple.com> | 2014-10-14 21:41:23 +0000 |
|---|---|---|
| committer | Juergen Ributzka <juergen@apple.com> | 2014-10-14 21:41:23 +0000 |
| commit | 4dfd590eaaa38aaa2ce7e09058d52780e445ae96 (patch) | |
| tree | 7b015c20216cc65cd696fc7f0fd0460234c16a96 /llvm/test/CodeGen/AArch64/fast-isel-gep.ll | |
| parent | f6aafeee6029bece1133250f3d9a65bd059c68fa (diff) | |
| download | bcm5719-llvm-4dfd590eaaa38aaa2ce7e09058d52780e445ae96.tar.gz bcm5719-llvm-4dfd590eaaa38aaa2ce7e09058d52780e445ae96.zip | |
[FastISel][AArch64] Add custom lowering for GEPs.
This is mostly a copy of the existing FastISel GEP code, but on AArch64 we bail
out even for simple cases, because the standard fastEmit functions don't cover
MUL and ADD is lowered inefficientily.
llvm-svn: 219726
Diffstat (limited to 'llvm/test/CodeGen/AArch64/fast-isel-gep.ll')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/fast-isel-gep.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/fast-isel-gep.ll b/llvm/test/CodeGen/AArch64/fast-isel-gep.ll new file mode 100644 index 00000000000..d72019801ba --- /dev/null +++ b/llvm/test/CodeGen/AArch64/fast-isel-gep.ll @@ -0,0 +1,18 @@ +; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort -verify-machineinstrs < %s | FileCheck %s + +%struct.foo = type { i32, i64, float, double } + +define double* @test_struct(%struct.foo* %f) { +; CHECK-LABEL: test_struct +; CHECK: add x0, x0, #24 + %1 = getelementptr inbounds %struct.foo* %f, i64 0, i32 3 + ret double* %1 +} + +define i32* @test_array(i32* %a, i64 %i) { +; CHECK-LABEL: test_array +; CHECK: orr [[REG:x[0-9]+]], xzr, #0x4 +; CHECK-NEXT: madd x0, x1, [[REG]], x0 + %1 = getelementptr inbounds i32* %a, i64 %i + ret i32* %1 +} |

