summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@mips.com>2018-07-25 12:35:01 +0000
committerPetar Jovanovic <petar.jovanovic@mips.com>2018-07-25 12:35:01 +0000
commit58c0210023b573ae80a706ac1d14c7dcffe6df24 (patch)
treecedb903a597e43b381a62124c8ddf649bf6a42fa /llvm/lib
parentba5ec9c684d4d6e9614ff9bf1b6d797f10918d79 (diff)
downloadbcm5719-llvm-58c0210023b573ae80a706ac1d14c7dcffe6df24.tar.gz
bcm5719-llvm-58c0210023b573ae80a706ac1d14c7dcffe6df24.zip
[MIPS GlobalISel] Lower pointer arguments
Add support for lowering pointer arguments. Changing type from pointer to integer is already done in MipsTargetLowering::getRegisterTypeForCallingConv. Patch by Petar Avramovic. Differential Revision: https://reviews.llvm.org/D49419 llvm-svn: 337912
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/MipsCallLowering.cpp2
-rw-r--r--llvm/lib/Target/Mips/MipsLegalizerInfo.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsCallLowering.cpp b/llvm/lib/Target/Mips/MipsCallLowering.cpp
index cb3c5ef752d..e82f62260b3 100644
--- a/llvm/lib/Target/Mips/MipsCallLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsCallLowering.cpp
@@ -186,6 +186,8 @@ bool OutgoingValueHandler::handle(ArrayRef<CCValAssign> ArgLocs,
static bool isSupportedType(Type *T) {
if (T->isIntegerTy() && T->getScalarSizeInBits() == 32)
return true;
+ if (T->isPointerTy())
+ return true;
return false;
}
diff --git a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
index 3e2fcd6122a..da6f9dabdaa 100644
--- a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
@@ -25,7 +25,7 @@ MipsLegalizerInfo::MipsLegalizerInfo(const MipsSubtarget &ST) {
getActionDefinitionsBuilder(G_ADD).legalFor({s32});
getActionDefinitionsBuilder({G_LOAD, G_STORE})
- .legalFor({{s32, p0}});
+ .legalForCartesianProduct({p0, s32}, {p0});
getActionDefinitionsBuilder(G_CONSTANT)
.legalFor({s32});
OpenPOWER on IntegriCloud