aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorGábor Spaits <gaborspaits1@gmail.com>2024-06-19 16:27:12 +0200
committerGitHub <noreply@github.com>2024-06-19 16:27:12 +0200
commitf4504083634ee73cfbb4593613a8f11487207ce6 (patch)
treea03f93571e01a102c903165ba63568cf56a10d96 /llvm/lib/Target
parent5b007582bb9142ccab47134e5d2de0dd451338af (diff)
downloadllvm-f4504083634ee73cfbb4593613a8f11487207ce6.zip
llvm-f4504083634ee73cfbb4593613a8f11487207ce6.tar.gz
llvm-f4504083634ee73cfbb4593613a8f11487207ce6.tar.bz2
[GISel][RISCV]Implement indirect parameter passing (#95429)
Some targets like RISC-V pass scalars wider than 2×XLEN bits by reference, so those arguments are replaced in the argument list with an address (See RISC-V ABIs Specification 1.0 section 2.1). This commit implements this indirect parameter passing in GlobalISel. --------- Co-authored-by: Gabor Spaits <Gabor.Spaits@hightec-rt.com>
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp b/llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp
index 2bfee45..b5f8715 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp
@@ -341,10 +341,8 @@ static bool isLegalElementTypeForRVV(Type *EltTy,
// TODO: Remove IsLowerArgs argument by adding support for vectors in lowerCall.
static bool isSupportedArgumentType(Type *T, const RISCVSubtarget &Subtarget,
bool IsLowerArgs = false) {
- // TODO: Integers larger than 2*XLen are passed indirectly which is not
- // supported yet.
if (T->isIntegerTy())
- return T->getIntegerBitWidth() <= Subtarget.getXLen() * 2;
+ return true;
if (T->isHalfTy() || T->isFloatTy() || T->isDoubleTy())
return true;
if (T->isPointerTy())