From: Sean Fertile Date: Mon, 11 May 2020 17:03:45 +0000 (-0400) Subject: [PowerPC][NFC] Convert an if/else to a conditional. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ea8d58f21a3505ec0e4dd168020c3846a1dfcc4;p=platform%2Fupstream%2Fllvm.git [PowerPC][NFC] Convert an if/else to a conditional. Change an if else to use a conditional which is shorter. Also name the conditonal value to make the code clearer. --- diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp index ad1f16b..7fbdf97 100644 --- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp @@ -1983,11 +1983,8 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF, std::min(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