diff options
author | Alex Bradbury <asb@lowrisc.org> | 2019-03-09 11:16:27 +0000 |
---|---|---|
committer | Alex Bradbury <asb@lowrisc.org> | 2019-03-09 11:16:27 +0000 |
commit | 62c8a57a7475eb81417f6fb087a6e89d5b0035ab (patch) | |
tree | 990e8754c87f3dc9d69aa786ce3788de5daecd34 /llvm/lib/Target/RISCV/RISCVISelLowering.cpp | |
parent | bd0eff316a4c7b833af06187ec8989ac28b5ae31 (diff) | |
download | bcm5719-llvm-62c8a57a7475eb81417f6fb087a6e89d5b0035ab.tar.gz bcm5719-llvm-62c8a57a7475eb81417f6fb087a6e89d5b0035ab.zip |
[RISCV][NFC] Minor refactoring of CC_RISCV
Immediately check if we need to early-exit as we have a return value that
can't be returned directly. Also tweak following if/else.
llvm-svn: 355773
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 37a91acdd1e..60041da0694 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -940,20 +940,20 @@ static bool CC_RISCV(const DataLayout &DL, unsigned ValNo, MVT ValVT, MVT LocVT, unsigned XLen = DL.getLargestLegalIntTypeSizeInBits(); assert(XLen == 32 || XLen == 64); MVT XLenVT = XLen == 32 ? MVT::i32 : MVT::i64; + + // Any return value split in to more than two values can't be returned + // directly. + if (IsRet && ValNo > 1) + return true; + if (ValVT == MVT::f32) { LocVT = XLenVT; LocInfo = CCValAssign::BCvt; - } - if (XLen == 64 && ValVT == MVT::f64) { + } else if (XLen == 64 && ValVT == MVT::f64) { LocVT = MVT::i64; LocInfo = CCValAssign::BCvt; } - // Any return value split in to more than two values can't be returned - // directly. - if (IsRet && ValNo > 1) - return true; - // If this is a variadic argument, the RISC-V calling convention requires // that it is assigned an 'even' or 'aligned' register if it has 8-byte // alignment (RV32) or 16-byte alignment (RV64). An aligned register should |