This is an archive of the discontinued LLVM Phabricator instance.

Make memory operands for MIs resulting from Memcpy/Memset on SystemZ
Needs ReviewPublic

Authored by jonpa on Jun 6 2017, 6:56 AM.

Details

Summary

On SystemZ, memory operands on the MIs that result from lowering of Memcpy (Memset is handled in a similar way) are currently missing.

I wanted to use the MachinePointerInfos passed to EmitTargetCodeForMemcpy(), but I did not find a simple way to just add them as an operand when calling DAG.getNode(). I therefore instead thought that since the achinePointerInfo is basically just a a Value and an offset, it might be good enough to just extract them
and reconstruct them during Pseudo Expansion.

It would of course have been nicer and cleaner to build SDNodes for these memory operands instead instead of extracting after isel. I however don't see any support for this... It seems MemSDNode has just one MachineMemOperand* as a protected member, so memcpy isn't supported with it, or? And there is no SDNode that would wrap a MachineMemOperand...

Is there any better way of doing this than per this patch? (I.e. making the memory operands in EmitTargetCodeForMemcpy() instead and passing them on through isel, to avoid the extraction).

Also, are these memory operands correct with just a load/store flag set?

Diff Detail

Event Timeline

jonpa created this revision.Jun 6 2017, 6:56 AM
efriedma edited edge metadata.Jun 6 2017, 1:09 PM

We don't current support MemIntrinsicSDNodes with more than one memory operand at the moment... but I don't think that would be hard to change. Probably worth fixing if you need it.