[llvm] 22fbd07 - [X86] combineLoad - consistently use cast<MemSDNode>. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 04:25:19 PST 2023


Author: Simon Pilgrim
Date: 2023-12-08T12:24:55Z
New Revision: 22fbd07bd768e7a7289815846ba37accd5dab9bd

URL: https://github.com/llvm/llvm-project/commit/22fbd07bd768e7a7289815846ba37accd5dab9bd
DIFF: https://github.com/llvm/llvm-project/commit/22fbd07bd768e7a7289815846ba37accd5dab9bd.diff

LOG: [X86] combineLoad - consistently use cast<MemSDNode>. NFCI.

getBasePtr()/getMemoryVT() are common methods for all memory nodes.

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 f7fe82fdf08a8..6d7c279f85935 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -49886,8 +49886,8 @@ static SDValue combineLoad(SDNode *N, SelectionDAG &DAG,
           User->getValueSizeInBits(0).getFixedValue() >
               RegVT.getFixedSizeInBits()) {
         if (User->getOpcode() == X86ISD::SUBV_BROADCAST_LOAD &&
-            cast<MemIntrinsicSDNode>(User)->getBasePtr() == Ptr &&
-            cast<MemIntrinsicSDNode>(User)->getMemoryVT().getSizeInBits() ==
+            cast<MemSDNode>(User)->getBasePtr() == Ptr &&
+            cast<MemSDNode>(User)->getMemoryVT().getSizeInBits() ==
                 MemVT.getSizeInBits()) {
           SDValue Extract = extractSubVector(SDValue(User, 0), 0, DAG, SDLoc(N),
                                              RegVT.getSizeInBits());
@@ -49915,7 +49915,7 @@ static SDValue combineLoad(SDNode *N, SelectionDAG &DAG,
         if (ISD::isNormalLoad(User)) {
           // See if we are loading a constant that matches in the lower
           // bits of a longer constant (but from a 
diff erent constant pool ptr).
-          SDValue UserPtr = cast<LoadSDNode>(User)->getBasePtr();
+          SDValue UserPtr = cast<MemSDNode>(User)->getBasePtr();
           const Constant *LdC = getTargetConstantFromBasePtr(Ptr);
           const Constant *UserC = getTargetConstantFromBasePtr(UserPtr);
           if (LdC && UserC && UserPtr != Ptr &&


        


More information about the llvm-commits mailing list