Page MenuHomePhabricator

[NewPM] Port FinalizeISel to the new pass manager.
Needs ReviewPublic

Authored by czhang on Jul 3 2019, 6:36 PM.

Event Timeline

czhang created this revision.Jul 3 2019, 6:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 3 2019, 6:36 PM
arsenm added a subscriber: arsenm.Jul 3 2019, 7:33 PM

This was renamed to FinalizeISel

czhang updated this revision to Diff 208558.Jul 8 2019, 5:49 PM

rebase (renamed pass) & clang-format

lenary added a subscriber: lenary.Jul 12 2019, 1:29 AM
czhang retitled this revision from [NewPM] Port ExpandISelPseudos to the new pass manager. to [NewPM] Port FinalizeISel to the new pass manager..Jul 15 2019, 10:23 AM
arsenm added inline comments.Jul 15 2019, 10:28 AM
llvm/include/llvm/CodeGen/FinalizeISel.h
26–31

Should these pass headers be sorted into an include/llvm/CodeGen/Passes directory?

llvm/lib/Passes/PassRegistry.def
321

Machine CSE doesn't belong in this patch?

czhang marked 2 inline comments as done.Jul 30 2019, 2:33 PM
czhang added inline comments.
llvm/include/llvm/CodeGen/FinalizeISel.h
26–31

Since the non-codegen passes in Analysis/ and Transform/ have their equivalent headers under paths corresponding to the implementation files, I think it is better to leave it like this for consistency with the normal IR passes.

czhang updated this revision to Diff 212448.Jul 30 2019, 3:04 PM
czhang marked an inline comment as done.

Fix misplaced machine-cse.

czhang marked an inline comment as done.Jul 30 2019, 3:05 PM

Just because the IR passes made a mess of this doesn't mean the same mistake should be repeated for CodeGen passes. I think the clutter of the pass headers should be sorted away to reduce the mental burden of figuring out which headers should be included by machine passes

llvm/lib/CodeGen/CodeGen.cpp
36

No PassPass

llvm/lib/CodeGen/FinalizeISel.cpp
46

Remove pass to avoid PassPass

czhang added a comment.Aug 1 2019, 1:27 PM

Just because the IR passes made a mess of this doesn't mean the same mistake should be repeated for CodeGen passes. I think the clutter of the pass headers should be sorted away to reduce the mental burden of figuring out which headers should be included by machine passes

I definitely hear what you are saying, but for the sake of consistency I believe it would be less confusing if we followed the IR pass convention for now. Then we could discuss potentially cleaning up both the IR pass and CodeGen pass headers at the same time.

czhang marked 3 inline comments as done.Aug 1 2019, 1:31 PM
czhang added inline comments.
llvm/lib/CodeGen/FinalizeISel.cpp
46

Again, for the sake of consistency, it may be less error-prone and confusing for future porters if we stick with the well established convention in having the ugly PassPass stick around for pass registration, ugly as it is. Basically every ported IR pass has a PassPass attached to it and it makes it clear that these are legacy passes. Of course, this probably won't even matter once all the passes are ported since it seems like the goal is to remove the legacy pass manager entirely once the transition is completed.

arsenm added inline comments.Aug 1 2019, 7:39 PM
llvm/lib/CodeGen/FinalizeISel.cpp
46

This isn't a well established convention. Some passes do, and some don't