[PATCH] D131544: [LegalizeTypes][NFC] Use dyn_cast instead of isa and cast.

WangLian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 23:19:21 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG130305788891: [LegalizeTypes][NFC] Use dyn_cast instead of isa and cast (authored by Jimerlife).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131544/new/

https://reviews.llvm.org/D131544

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -3033,8 +3033,8 @@
   SDValue Idx = N->getOperand(1);
   EVT VecVT = Vec.getValueType();
 
-  if (isa<ConstantSDNode>(Idx)) {
-    uint64_t IdxVal = cast<ConstantSDNode>(Idx)->getZExtValue();
+  if (const ConstantSDNode *Index = dyn_cast<ConstantSDNode>(Idx)) {
+    uint64_t IdxVal = Index->getZExtValue();
 
     SDValue Lo, Hi;
     GetSplitVector(Vec, Lo, Hi);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131544.452085.patch
Type: text/x-patch
Size: 613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220812/bbcbebdc/attachment.bin>


More information about the llvm-commits mailing list