[X86] Explicitly pass Pointer, MachinePointerInfo and Alignment to BuildFILD.
authorCraig Topper <craig.topper@intel.com>
Thu, 27 Feb 2020 00:02:32 +0000 (16:02 -0800)
committerCraig Topper <craig.topper@intel.com>
Thu, 27 Feb 2020 00:26:26 +0000 (16:26 -0800)
commit15e2831fcd7e58db12d110f1624085d1e683e4a6
tree19cc2e0828096918afdd1d49b0017d8e9a14b15e
parent12339efd70966edd2016206ddae2fbfdf748d400
[X86] Explicitly pass Pointer, MachinePointerInfo and Alignment to BuildFILD.

Previously this code was called into two ways, either a FrameIndexSDNode
was passed in StackSlot. Or a load node was passed in the argument
called StackSlot. This was determined by a dyn_cast to FrameIndexSDNode.

In the case of a load, we had to go find the real pointer from
operand 0 and cast the node to MemSDNode to find the pointer info.

For the stack slot case, the code assumed that the stack slot
was perfectly aligned despite not being the creator of the slot.

This commit modifies the interface to make the caller responsible
for passing all of the required information to avoid all the
guess work and reverse engineering.

I'm not aware of any issues with the original code after an
earlier commit to fix the alignment of one of the stack objects.
This is just clean up to make the code less surprising.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h