This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Add MMOs to statepoint nodes during SelectionDAG
ClosedPublic

Authored by reames on Mar 7 2019, 12:47 PM.

Details

Summary

The existing statepoint lowering code does something odd; it adds machine memory operands post instruction selection. This was copied from the stackmap/patchpoint implementation, but appears to be non-idiomatic.

This change is largely NFC. It moves the MMO creation logic into SelectionDAG building. It ends up not quite being NFC because the size of the stack slot is reflected in the MMO. The old code blindly used pointer size for the MMO size, which appears to have always been incorrect for larger values. It just happened nothing actually relied on the MMOs, so it worked out okay.

For context, I'm planning on removing the MOVolatile flag from these in a future commit, and then removing the MOStore flag from deopt spill slots in a separate one. Doing so is motivated by a small test case where we should be able to better schedule spill slots, but don't do so due to a memory use/def implied by the statepoint.

Diff Detail

Repository
rL LLVM

Event Timeline

reames created this revision.Mar 7 2019, 12:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2019, 12:47 PM
skatkov accepted this revision.Mar 10 2019, 11:44 PM

lgtm.

lib/CodeGen/SelectionDAG/StatepointLowering.cpp
473 ↗(On Diff #189769)

new line missed.

This revision is now accepted and ready to land.Mar 10 2019, 11:44 PM
This revision was automatically updated to reflect the committed changes.