summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-08-27 21:38:33 +0000
committerJuergen Ributzka <juergen@apple.com>2014-08-27 21:38:33 +0000
commit3c1b2861524aa3b2f6009316f2bbe0beb23b21c0 (patch)
treed48bcf4469bbbeee013b316125c0352de04dd713 /llvm/lib/Target
parent9a45fac6f73f6c772fe96773ae3beab6f24c534c (diff)
downloadbcm5719-llvm-3c1b2861524aa3b2f6009316f2bbe0beb23b21c0.tar.gz
bcm5719-llvm-3c1b2861524aa3b2f6009316f2bbe0beb23b21c0.zip
[FastISel][AArch64] Fix simplify address when the address comes from a shift.
When the address comes directly from a shift instruction then the address computation cannot be folded into the memory instruction, because the zero register is not available as a base register. Simplify addess needs to emit the shift instruction and use the result as base register. llvm-svn: 216621
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64FastISel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
index a6e7daa0d9b..2faa1398064 100644
--- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
@@ -708,6 +708,10 @@ bool AArch64FastISel::SimplifyAddress(Address &Addr, MVT VT) {
Addr.getOffsetReg())
RegisterOffsetNeedsLowering = true;
+ // Cannot encode zero register as base.
+ if (Addr.isRegBase() && Addr.getOffsetReg() && !Addr.getReg())
+ RegisterOffsetNeedsLowering = true;
+
// If this is a stack pointer and the offset needs to be simplified then put
// the alloca address into a register, set the base type back to register and
// continue. This should almost never happen.
OpenPOWER on IntegriCloud