This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] First steps at porting CodeGen to new pass manager,
AbandonedPublic

Authored by czhang on Jun 27 2019, 12:59 PM.

Details

Summary

This allows llc to run passes (currently only MCP) with the
new PM using the --run-new-passes option. --run-passes must be
specified to be none.

Patch for discussion -- Only two tests in AMDGPU fail due to (imo) questionable
usage of the legacy PM to access perf hints, which had to be commented out. Suggestions?

Event Timeline

czhang created this revision.Jun 27 2019, 12:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2019, 12:59 PM
czhang retitled this revision from [CodeGen] Define an interface for the new pass manager in CodeGen. to [CodeGen] First steps at porting CodeGen to new pass manager,.Jun 27 2019, 1:01 PM
czhang edited the summary of this revision. (Show Details)
czhang added a reviewer: chandlerc.
arsenm added inline comments.Jun 27 2019, 2:31 PM
llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
32–39

This should really be a MachineFunction analysis. Would adding a separate MachineFunction pass with a dependency on this analysis which sets the field here work?

markus added a subscriber: markus.Jun 27 2019, 11:52 PM
markus removed a subscriber: markus.
markus added a subscriber: markus.
fedor.sergeev added a reviewer: chandlerc.

Thanks for starting this effort!

I have not yet spent any good time reviewing this but it is rather obvious that the patch is too large.
It it needs to be broken into a series of patches, at least separating:

  • introduction of Machine-level NewPM constructs, with its own unit tests etc
  • porting legacy passes into newpm passes

Say, all those changes that just rename MachineModuleInfo into MachineModuleInfoWrapperPass are quite distracting.
But as I said, thanks for the effort!

niosHD added a subscriber: niosHD.Jul 2 2019, 8:43 AM
czhang added a comment.Jul 8 2019, 5:53 PM

Patch series rebased. Thanks to @arsenm the test-suite no longer has any failures.