[llvm] 543b30d - [VE][NFC] Change cast to dyn_cast
Kazushi Marukawa via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 04:49:25 PST 2020
Author: Kazushi (Jam) Marukawa
Date: 2020-11-10T21:49:16+09:00
New Revision: 543b30db06bf992c4b33ccba4e53e9905b101b7c
URL: https://github.com/llvm/llvm-project/commit/543b30db06bf992c4b33ccba4e53e9905b101b7c
DIFF: https://github.com/llvm/llvm-project/commit/543b30db06bf992c4b33ccba4e53e9905b101b7c.diff
LOG: [VE][NFC] Change cast to dyn_cast
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.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D91151
Added:
Modified:
llvm/lib/Target/VE/VEISelDAGToDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/VE/VEISelDAGToDAG.cpp b/llvm/lib/Target/VE/VEISelDAGToDAG.cpp
index 13759646fe91..dc7e11825faa 100644
--- a/llvm/lib/Target/VE/VEISelDAGToDAG.cpp
+++ b/llvm/lib/Target/VE/VEISelDAGToDAG.cpp
@@ -236,7 +236,7 @@ bool VEDAGToDAGISel::selectADDRzii(SDValue Addr, SDValue &Base, SDValue &Index,
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);
More information about the llvm-commits
mailing list