@@ -395,11 +395,6 @@ bool llvm::CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT,
395
395
return false ;
396
396
}
397
397
398
- // Fixed-length vectors are located in the corresponding scalable-vector
399
- // container types.
400
- if (ValVT.isFixedLengthVector ())
401
- LocVT = TLI.getContainerForFixedLengthVector (LocVT);
402
-
403
398
// Split arguments might be passed indirectly, so keep track of the pending
404
399
// values. Split vectors are passed via a mix of registers and indirectly, so
405
400
// treat them as we would any other argument.
@@ -443,7 +438,12 @@ bool llvm::CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT,
443
438
Reg = State.AllocateReg (ArgFPR64s);
444
439
else if (ValVT.isVector () || ValVT.isRISCVVectorTuple ()) {
445
440
Reg = allocateRVVReg (ValVT, ValNo, State, TLI);
446
- if (!Reg) {
441
+ if (Reg) {
442
+ // Fixed-length vectors are located in the corresponding scalable-vector
443
+ // container types.
444
+ if (ValVT.isFixedLengthVector ())
445
+ LocVT = TLI.getContainerForFixedLengthVector (LocVT);
446
+ } else {
447
447
// For return values, the vector must be passed fully via registers or
448
448
// via the stack.
449
449
// FIXME: The proposed vector ABI only mandates v8-v15 for return values,
@@ -458,8 +458,6 @@ bool llvm::CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT,
458
458
LocVT = XLenVT;
459
459
LocInfo = CCValAssign::Indirect;
460
460
} else {
461
- // Pass fixed-length vectors on the stack.
462
- LocVT = ValVT;
463
461
StoreSizeBytes = ValVT.getStoreSize ();
464
462
// Align vectors to their element sizes, being careful for vXi1
465
463
// vectors.
0 commit comments