[PowerPC][NFC] Convert an if/else to a conditional.
authorSean Fertile <sd.fertile@gmail.com>
Mon, 11 May 2020 17:03:45 +0000 (13:03 -0400)
committerSean Fertile <sd.fertile@gmail.com>
Mon, 11 May 2020 17:05:19 +0000 (13:05 -0400)
Change an if else to use a conditional which is shorter. Also name the
conditonal value to make the code clearer.

llvm/lib/Target/PowerPC/PPCFrameLowering.cpp

index ad1f16b..7fbdf97 100644 (file)
@@ -1983,11 +1983,8 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
       std::min<unsigned>(TRI->getEncodingValue(MinGPR),
                          TRI->getEncodingValue(MinG8R));
 
-    if (Subtarget.isPPC64()) {
-      LowerBound -= (31 - MinReg + 1) * 8;
-    } else {
-      LowerBound -= (31 - MinReg + 1) * 4;
-    }
+    const unsigned GPRegSize = Subtarget.isPPC64() ? 8 : 4;
+    LowerBound -= (31 - MinReg + 1) * GPRegSize;
   }
 
   // For 32-bit only, the CR save area is below the general register