[mips] Reduce number of nested `if` statements. NFC
authorSimon Atanasyan <simon@atanasyan.com>
Tue, 12 Nov 2019 12:35:16 +0000 (15:35 +0300)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 13 Nov 2019 19:57:55 +0000 (22:57 +0300)
llvm/lib/Target/Mips/MipsISelLowering.cpp

index eb460ca37979ef7287adf42822a1e4854070c9cf..56db378ae6d452c113d83ed2d9a967d86deb702e 100644 (file)
@@ -111,14 +111,11 @@ static bool isShiftedMask(uint64_t I, uint64_t &Pos, uint64_t &Size) {
 MVT MipsTargetLowering::getRegisterTypeForCallingConv(LLVMContext &Context,
                                                       CallingConv::ID CC,
                                                       EVT VT) const {
-  if (VT.isVector()) {
-      if (Subtarget.isABI_O32()) {
-        return MVT::i32;
-      } else {
-        return (VT.getSizeInBits() == 32) ? MVT::i32 : MVT::i64;
-      }
-  }
-  return MipsTargetLowering::getRegisterType(Context, VT);
+  if (!VT.isVector())
+    return getRegisterType(Context, VT);
+
+  return Subtarget.isABI_O32() || VT.getSizeInBits() == 32 ? MVT::i32
+                                                           : MVT::i64;
 }
 
 unsigned MipsTargetLowering::getNumRegistersForCallingConv(LLVMContext &Context,