[PATCH] D131544: [LegalizeTypes][NFC] Use dyn_cast instead of isa and cast.
WangLian via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 10 18:43:13 PDT 2022
Jimerlife updated this revision to Diff 451699.
Jimerlife added a comment.
address comment
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 (auto *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.451699.patch
Type: text/x-patch
Size: 597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220811/58704804/attachment.bin>
More information about the llvm-commits
mailing list