llvm.org GIT mirror llvm / 92108e3
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355773 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Bradbury 1 year, 8 months ago
1 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
939939 unsigned XLen = DL.getLargestLegalIntTypeSizeInBits();
940940 assert(XLen == 32 || XLen == 64);
941941 MVT XLenVT = XLen == 32 ? MVT::i32 : MVT::i64;
942 if (ValVT == MVT::f32) {
943 LocVT = XLenVT;
944 LocInfo = CCValAssign::BCvt;
945 }
946 if (XLen == 64 && ValVT == MVT::f64) {
947 LocVT = MVT::i64;
948 LocInfo = CCValAssign::BCvt;
949 }
950942
951943 // Any return value split in to more than two values can't be returned
952944 // directly.
953945 if (IsRet && ValNo > 1)
954946 return true;
947
948 if (ValVT == MVT::f32) {
949 LocVT = XLenVT;
950 LocInfo = CCValAssign::BCvt;
951 } else if (XLen == 64 && ValVT == MVT::f64) {
952 LocVT = MVT::i64;
953 LocInfo = CCValAssign::BCvt;
954 }
955955
956956 // If this is a variadic argument, the RISC-V calling convention requires
957957 // that it is assigned an 'even' or 'aligned' register if it has 8-byte