X86SelectionDAGInfo.cpp - move dyn_cast check inside if(). NFC.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 7 Dec 2022 14:16:41 +0000 (14:16 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 7 Dec 2022 14:21:24 +0000 (14:21 +0000)
Minor cleanup - we only use the non-null pointer inside the if() block

llvm/lib/Target/X86/X86SelectionDAGInfo.cpp

index 78a286a..f47d8a6 100644 (file)
@@ -74,9 +74,8 @@ SDValue X86SelectionDAGInfo::EmitTargetCodeForMemset(
   SDValue InFlag;
   EVT AVT;
   SDValue Count;
-  ConstantSDNode *ValC = dyn_cast<ConstantSDNode>(Val);
   unsigned BytesLeft = 0;
-  if (ValC) {
+  if (auto *ValC = dyn_cast<ConstantSDNode>(Val)) {
     unsigned ValReg;
     uint64_t Val = ValC->getZExtValue() & 255;