[PATCH] D57139: GlobalISel: Fix creating MMOs with align 0

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 13:51:22 PST 2019


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:854
         .addMemOperand(MF->getMachineMemOperand(
-            MachinePointerInfo(Ptr), MachineMemOperand::MOStore, ListSize, 0));
+            MachinePointerInfo(Ptr), MachineMemOperand::MOStore, ListSize, 1));
     return true;
----------------
aemerson wrote:
> arsenm wrote:
> > aemerson wrote:
> > > Can we use DL.getABITypeAlignment() here?
> > Probably? I don't know anything about vastart. I'm not sure why this has an MMO in the first place
> vastart's argument is a target dependent pointer to a va_list object on the stack, so I think it's worth it to try to get the right alignment. That said, 1 is always safe so I think it's ok to use for now.
I've looked at what SelectionDAG does for this, and I'm still not clear on what to use. The targets are creating the MMO there, and each one seems to be doing something different. Most of the cases seem to create a MachinePointerInfo and then get*Store functions magically infer an alignment from the underlying IR value. Some targets are hardcoding this. I think this is a separate patch


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

https://reviews.llvm.org/D57139





More information about the llvm-commits mailing list