From 4e87da88e63fa280badb3fb0cd510bbc68d71bc8 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 26 Dec 2015 19:48:37 +0000 Subject: [PATCH] [X86] Fold some variable declarations and initializations into if statements. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256451 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 4580f8cdf1a..691fdedeae3 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -4922,8 +4922,7 @@ static bool getTargetShuffleMask(SDNode *N, MVT VT, if (MaskNode->getOpcode() == X86ISD::VBROADCAST) { unsigned NumEltsInMask = MaskNode->getNumOperands(); MaskNode = MaskNode->getOperand(0); - auto *CN = dyn_cast(MaskNode); - if (CN) { + if (auto *CN = dyn_cast(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 *N, MVT VT, if (!MaskCP || MaskCP->isMachineConstantPoolEntry()) return false; - auto *C = dyn_cast(MaskCP->getConstVal()); - if (C) { + if (auto *C = dyn_cast(MaskCP->getConstVal())) { DecodeVPERMVMask(C, VT, Mask); if (Mask.empty()) return false; @@ -4999,8 +4997,7 @@ static bool getTargetShuffleMask(SDNode *N, MVT VT, if (!MaskCP || MaskCP->isMachineConstantPoolEntry()) return false; - auto *C = dyn_cast(MaskCP->getConstVal()); - if (C) { + if (auto *C = dyn_cast(MaskCP->getConstVal())) { DecodeVPERMV3Mask(C, VT, Mask); if (Mask.empty()) return false; -- 2.34.1