[PATCH] D140638: [Codegen][LegalizeIntegerTypes] New legalization strategy for scalar shifts: shift through stack

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 19:11:44 PST 2023


efriedma added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:4160
+  // And spill it into the stack slot.
+  Ch = DAG.getStore(Ch, dl, Init, StackPtr, MachinePointerInfo());
+
----------------
lebedev.ri wrote:
> efriedma wrote:
> > MachinePointerInfo::getUnknownStack instead of MachinePointerInfo()?  Or actually, DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR does the following:
> > 
> > ```
> >   auto FrameIndex = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex();
> >   auto PtrInfo = MachinePointerInfo::getFixedStack(MF, FrameIndex);
> > ```
> As per @craig.topper, and looking at `-debug`,
> we get right `MachinePointerInfo` for stack-based
> memory operations automatically. Not doing that manually
> frees us from having to track alignment, too.
I guess optimizations kick in, sure, so you don't need to compute the exact pointer info.

But please at least use getUnknownStack(); a default-constructed MachinePointerInfo implicitly points to address-space zero.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140638



More information about the llvm-commits mailing list