diff options
| author | Tim Northover <t.p.northover@gmail.com> | 2018-09-24 14:07:59 +0100 |
|---|---|---|
| committer | Tim Northover <t.p.northover@gmail.com> | 2019-11-18 14:35:05 +0000 |
| commit | dea8f3b0a4eabb930f605343ff5e3e39a1791f86 (patch) | |
| tree | d312777b0a52b0b37d784fbb9cf51adf22ae424b /llvm/lib/Target/AArch64/AArch64FastISel.cpp | |
| parent | dca2b36ba097085663ae8473f01f0353c33f7ff0 (diff) | |
| download | bcm5719-llvm-dea8f3b0a4eabb930f605343ff5e3e39a1791f86.tar.gz bcm5719-llvm-dea8f3b0a4eabb930f605343ff5e3e39a1791f86.zip | |
arm64_32: support function return in FastISel.
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64FastISel.cpp')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64FastISel.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp index 98410c2e747..7a8243ad7c9 100644 --- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp +++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp @@ -3838,11 +3838,6 @@ bool AArch64FastISel::selectRet(const Instruction *I) { if (!FuncInfo.CanLowerReturn) return false; - // FIXME: in principle it could. Mostly just a case of zero extending outgoing - // pointers. - if (Subtarget->isTargetILP32()) - return false; - if (F.isVarArg()) return false; @@ -3922,6 +3917,11 @@ bool AArch64FastISel::selectRet(const Instruction *I) { return false; } + // "Callee" (i.e. value producer) zero extends pointers at function + // boundary. + if (Subtarget->isTargetILP32() && RV->getType()->isPointerTy()) + SrcReg = emitAnd_ri(MVT::i64, SrcReg, false, 0xffffffff); + // Make the copy. BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TargetOpcode::COPY), DestReg).addReg(SrcReg); @@ -5011,6 +5011,9 @@ std::pair<unsigned, bool> AArch64FastISel::getRegForGEPIndex(const Value *Idx) { /// simple cases. This is because the standard fastEmit functions don't cover /// MUL at all and ADD is lowered very inefficientily. bool AArch64FastISel::selectGetElementPtr(const Instruction *I) { + if (Subtarget->isTargetILP32()) + return false; + unsigned N = getRegForValue(I->getOperand(0)); if (!N) return false; |

