This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Remove pipeline dependencies on StackProtector; NFC
ClosedPublic

Authored by MatzeB on Jul 12 2018, 10:53 AM.

Details

Summary

Note: This just an updated version of a patch by @rinon:

  • Merge SSPLK enums
  • Initialize MachineFrameInfo once per function (not once per BB)
  • Stop MachineFunctionPasses to preserve StackProtector by default. Unfortunately this requires to add the preserved flag to all GlobalISel passes as they schedule a fallback SelectionDAG instance later in the pipeline...

Commit Message:

PrologEpilogInserter and StackColoring depend on the StackProtector analysis
being alive from the point it is run until PEI, which requires that they are all
scheduled in the same FunctionPassManager. Inserting a (machine) ModulePass
between StackProtector and PEI results in these passes being in separate
FunctionPassManagers and the StackProtector is not available for PEI.

PEI and StackColoring don't use much information from the StackProtector pass,
so transfering the required information to MachineFrameInfo is cleaner than
keeping the StackProtector pass around. This commit moves the SSP layout
information to MFI instead of keeping it in the pass.

This patch set (D37580, D37581, D37582, D37583, D37584, D37585, D37586, D37587)
is a first draft of the pagerando implementation described in
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113794.html.

Patch by Stephen Crane <sjc@immunant.com>

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB created this revision.Jul 12 2018, 10:53 AM
MatzeB updated this revision to Diff 155229.Jul 12 2018, 11:19 AM

turns out my checkout was slightly outdated too, rebased. Fixed warning.

thegameg accepted this revision.Jul 12 2018, 11:28 AM

This seems to take care of my concerns from the other patch. LGTM, thanks for looking into this again!

This revision is now accepted and ready to land.Jul 12 2018, 11:28 AM
rinon accepted this revision.Jul 12 2018, 11:34 AM

Thanks for updating this! LGTM.

lib/CodeGen/StackProtector.cpp
516

Good call on moving this into StackProtector, it's definitely better here.

This revision was automatically updated to reflect the committed changes.