[SelectionDAG] Use dyn_cast without cast.
authorFlorian Hahn <florian.hahn@arm.com>
Sat, 21 Oct 2017 05:37:10 +0000 (05:37 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Sat, 21 Oct 2017 05:37:10 +0000 (05:37 +0000)
llvm-svn: 316258

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 63f9198..b6e3efe 100644 (file)
@@ -2966,8 +2966,8 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
   unsigned Tmp, Tmp2;
   unsigned FirstAnswer = 1;
 
-  if (isa<ConstantSDNode>(Op)) {
-    const APInt &Val = cast<ConstantSDNode>(Op)->getAPIntValue();
+  if (auto *C = dyn_cast<ConstantSDNode>(Op)) {
+    const APInt &Val = C->getAPIntValue();
     return Val.getNumSignBits();
   }