[PATCH] D114582: [SDAG] Refine MMO size when converting masked load/store to normal load/store

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 03:44:35 PST 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:10117
+        MLD->getOriginalAlign(), MLD->getAAInfo(), MLD->getRanges());
     SDValue NewLd = DAG.getLoad(N->getValueType(0), SDLoc(N), MLD->getChain(),
+                                MLD->getBasePtr(), MMO);
----------------
craig.topper wrote:
> Can we just one of the other signatures of getLoad and let it rebuild the MMO? Like this one
> 
> ```
> SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,            
>                               SDValue Ptr, MachinePointerInfo PtrInfo,           
>                               MaybeAlign Alignment,                              
>                               MachineMemOperand::Flags MMOFlags,                 
>                               const AAMDNodes &AAInfo, const MDNode *Ranges)
> ```
> 
> Or is there a risk that MemVT and VT don't match?
Yeah sounds good. We check that the masked load is non-extending, so I believe it should be OK.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114582/new/

https://reviews.llvm.org/D114582



More information about the llvm-commits mailing list