[PATCH] D91151: [VE][NFC] Change cast to dyn_cast

Kazushi Marukawa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 04:33:01 PST 2020


kaz7 created this revision.
kaz7 added reviewers: simoll, k-ishizaka.
kaz7 added projects: LLVM, VE.
Herald added subscribers: llvm-commits, hiraditya.
kaz7 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

We used cast where we should use dyn_cast.  So, change it this time.
Old code cause problems if I implement brind instruction and compile
openmp using new compiler.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91151

Files:
  llvm/lib/Target/VE/VEISelDAGToDAG.cpp


Index: llvm/lib/Target/VE/VEISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/VE/VEISelDAGToDAG.cpp
+++ llvm/lib/Target/VE/VEISelDAGToDAG.cpp
@@ -236,7 +236,7 @@
       Addr.getOpcode() == ISD::TargetGlobalTLSAddress)
     return false; // direct calls.
 
-  if (ConstantSDNode *CN = cast<ConstantSDNode>(Addr)) {
+  if (auto *CN = dyn_cast<ConstantSDNode>(Addr)) {
     if (isInt<32>(CN->getSExtValue())) {
       Base = CurDAG->getTargetConstant(0, SDLoc(Addr), MVT::i32);
       Index = CurDAG->getTargetConstant(0, SDLoc(Addr), MVT::i32);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91151.304139.patch
Type: text/x-patch
Size: 598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201110/74be2c20/attachment.bin>


More information about the llvm-commits mailing list