Skip to content

Commit 4b1f7e2

Browse files
don't support vectors for lowerCall
1 parent d413727 commit 4b1f7e2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ RISCVCallLowering::RISCVCallLowering(const RISCVTargetLowering &TLI)
298298
: CallLowering(&TLI) {}
299299

300300
// TODO: Support all argument types.
301-
static bool isSupportedArgumentType(Type *T, const RISCVSubtarget &Subtarget) {
301+
// TODO: Remove IsLowerArgs argument by adding support for vectors in lowerCall.
302+
static bool isSupportedArgumentType(Type *T, const RISCVSubtarget &Subtarget,
303+
bool IsLowerArgs = false) {
302304
// TODO: Integers larger than 2*XLen are passed indirectly which is not
303305
// supported yet.
304306
if (T->isIntegerTy())
@@ -308,7 +310,8 @@ static bool isSupportedArgumentType(Type *T, const RISCVSubtarget &Subtarget) {
308310
if (T->isPointerTy())
309311
return true;
310312
// TODO: Support fixed vector types.
311-
if (T->isVectorTy() && T->isScalableTy() && Subtarget.hasVInstructions())
313+
if (IsLowerArgs && T->isVectorTy() && T->isScalableTy() &&
314+
Subtarget.hasVInstructions())
312315
return true;
313316
return false;
314317
}
@@ -397,7 +400,7 @@ bool RISCVCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
397400
const RISCVSubtarget &Subtarget =
398401
MIRBuilder.getMF().getSubtarget<RISCVSubtarget>();
399402
for (auto &Arg : F.args()) {
400-
if (!isSupportedArgumentType(Arg.getType(), Subtarget))
403+
if (!isSupportedArgumentType(Arg.getType(), Subtarget, /*IsLowerArgs*/true))
401404
return false;
402405
}
403406

0 commit comments

Comments
 (0)