]> granicus.if.org Git - llvm/commitdiff
[DAGCombiner] Replace two unchecked dyn_casts with casts.
authorCraig Topper <craig.topper@intel.com>
Sun, 2 Jun 2019 03:31:01 +0000 (03:31 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 2 Jun 2019 03:31:01 +0000 (03:31 +0000)
The results of the dyn_casts were immediately dereferenced on the next line
so they had better not be null.

I don't think there's any way for these dyn_casts to fail, so use a cast
of adding null check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362315 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 773e0281b173b56c7424a548a74d4210f217081c..4ed17440abc0313d723a636de96ddcfa92574354 100644 (file)
@@ -8068,7 +8068,7 @@ SDValue DAGCombiner::visitMSTORE(SDNode *N) {
   if (Level >= AfterLegalizeTypes)
     return SDValue();
 
-  MaskedStoreSDNode *MST = dyn_cast<MaskedStoreSDNode>(N);
+  MaskedStoreSDNode *MST = cast<MaskedStoreSDNode>(N);
   SDValue Mask = MST->getMask();
   SDValue Data  = MST->getValue();
   EVT VT = Data.getValueType();
@@ -8219,7 +8219,7 @@ SDValue DAGCombiner::visitMLOAD(SDNode *N) {
   if (Level >= AfterLegalizeTypes)
     return SDValue();
 
-  MaskedLoadSDNode *MLD = dyn_cast<MaskedLoadSDNode>(N);
+  MaskedLoadSDNode *MLD = cast<MaskedLoadSDNode>(N);
   SDValue Mask = MLD->getMask();
   SDLoc DL(N);