[PATCH] D18106: Extract out a SelectionDAGBuilder::LowerAsStatepoint; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 18:45:00 PDT 2016


sanjoy updated this revision to Diff 50789.
sanjoy added a comment.

I moved some code around, and now have a separation between the
information needed to lower the call itself and the "meta" statepoint
information.  Out of this I'll try to split out the
populateCallLoweringInfo (and land them if they look trivial).

However, there is one snag -- the `Chain` parameter of
`CallLoweringInfo`.  With this new organization, we create the
`CallLoweringInfo` instance earlier than the spills, the CALL_SEQ
nodes end up anchoring to an earlier chain (since
populateCallLoweringInfo set `CLI.Chain` to `DAG.getRoot()`) and the
spill code gets DCE'd away.

In the current form of the patch, this is "fixed" by re-setting the
chain later, after we've emitted the spill code.  But then the
`CallLoweringInfo` instance we create is invalid to use till we re-set
the chain which, which is ugly.

The Right(TM) fix to this is to (I think) pass in an explicit `Chain`
parameter to all the places that consume a CLI, since the Chain is not
part of the thing we're lowering, but a part of the location we want
to lower it at.  However, that is a large (but simple) API change
touching all targets.


http://reviews.llvm.org/D18106

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  lib/CodeGen/SelectionDAG/StatepointLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18106.50789.patch
Type: text/x-patch
Size: 25463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160316/3f773f06/attachment.bin>


More information about the llvm-commits mailing list