[llvm] 2ab0148 - [x86] use cast instead of dyn_cast for unchecked usage; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 05:22:59 PDT 2021


Author: Sanjay Patel
Date: 2021-10-26T08:20:19-04:00
New Revision: 2ab0148c140dc54efea111b50b1650b7e3bdbfeb

URL: https://github.com/llvm/llvm-project/commit/2ab0148c140dc54efea111b50b1650b7e3bdbfeb
DIFF: https://github.com/llvm/llvm-project/commit/2ab0148c140dc54efea111b50b1650b7e3bdbfeb.diff

LOG: [x86] use cast instead of dyn_cast for unchecked usage; NFC

This was noted as an independent clean-up in D112464.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 0ae7bad2bcee..ff83813f29c0 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -5050,7 +5050,7 @@ static bool MayFoldLoadIntoBroadcastFromMem(SDValue Op, MVT EltVT,
 
   // We can not replace a wide volatile load with a broadcast-from-memory,
   // because that would narrow the load, which isn't legal for volatiles.
-  const LoadSDNode *Ld = dyn_cast<LoadSDNode>(Op.getNode());
+  auto *Ld = cast<LoadSDNode>(Op.getNode());
   return !Ld->isVolatile() ||
          Ld->getValueSizeInBits(0) == EltVT.getScalarSizeInBits();
 }


        


More information about the llvm-commits mailing list