[llvm] r256451 - [X86] Fold some variable declarations and initializations into if statements. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 26 11:48:39 PST 2015
Author: ctopper
Date: Sat Dec 26 13:48:37 2015
New Revision: 256451
URL: http://llvm.org/viewvc/llvm-project?rev=256451&view=rev
Log:
[X86] Fold some variable declarations and initializations into if statements. NFC
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=256451&r1=256450&r2=256451&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Dec 26 13:48:37 2015
@@ -4922,8 +4922,7 @@ static bool getTargetShuffleMask(SDNode
if (MaskNode->getOpcode() == X86ISD::VBROADCAST) {
unsigned NumEltsInMask = MaskNode->getNumOperands();
MaskNode = MaskNode->getOperand(0);
- auto *CN = dyn_cast<ConstantSDNode>(MaskNode);
- if (CN) {
+ if (auto *CN = dyn_cast<ConstantSDNode>(MaskNode)) {
APInt MaskEltValue = CN->getAPIntValue();
for (unsigned i = 0; i < NumEltsInMask; ++i)
RawMask.push_back(MaskEltValue.getLoBits(MaskLoBits).getZExtValue());
@@ -4946,8 +4945,7 @@ static bool getTargetShuffleMask(SDNode
if (!MaskCP || MaskCP->isMachineConstantPoolEntry())
return false;
- auto *C = dyn_cast<Constant>(MaskCP->getConstVal());
- if (C) {
+ if (auto *C = dyn_cast<Constant>(MaskCP->getConstVal())) {
DecodeVPERMVMask(C, VT, Mask);
if (Mask.empty())
return false;
@@ -4999,8 +4997,7 @@ static bool getTargetShuffleMask(SDNode
if (!MaskCP || MaskCP->isMachineConstantPoolEntry())
return false;
- auto *C = dyn_cast<Constant>(MaskCP->getConstVal());
- if (C) {
+ if (auto *C = dyn_cast<Constant>(MaskCP->getConstVal())) {
DecodeVPERMV3Mask(C, VT, Mask);
if (Mask.empty())
return false;
More information about the llvm-commits
mailing list