This is an archive of the discontinued LLVM Phabricator instance.

[MachineOutliner] Cleanup: move findCandidates out of suffix tree
ClosedPublic

Authored by paquette on Jul 27 2017, 3:52 PM.

Details

Reviewers
MatzeB
qcolombet
Summary

Doing some cleanup on the outliner in preparation for some functional changes. This patch moves findCandidates out of the suffix tree. (No test attached since it's just some tidying that doesn't impact the behaviour of the outliner.) Also adds a couple FIXMEs for future cleanup/improvements.

It's much easier to see what's going on when benefit calculations and queries are in the same place. Because the suffix tree ought not to know target-specific details, it makes sense to yank this out of the tree.

Diff Detail

Event Timeline

paquette created this revision.Jul 27 2017, 3:52 PM
MatzeB accepted this revision.Jul 27 2017, 3:59 PM

Looks like NFC to me.

lib/CodeGen/MachineOutliner.cpp
1060–1062

can't you just make this "OUTLINE_FUNCTION_"?

This revision is now accepted and ready to land.Jul 27 2017, 3:59 PM
paquette updated this revision to Diff 108537.Jul 27 2017, 4:04 PM

Even better: put findCandidates actually *inside* the MachineOutliner class for consistency.

paquette marked an inline comment as done.Jul 27 2017, 4:09 PM
paquette added inline comments.
lib/CodeGen/MachineOutliner.cpp
1060–1062

I think that sounds a little strange, since the function was "outlined"... But it's a character shorter so I'll go ahead and change it.

MatzeB added a comment.EditedJul 27 2017, 4:09 PM

Even better: put findCandidates actually *inside* the MachineOutliner class for consistency.

Still LGTM. And if it's just moving code around inside a file you authored, just do it without phabricator review. Post-commit review is fine.

paquette marked an inline comment as done.Jul 27 2017, 4:10 PM

Even better: put findCandidates actually *inside* the MachineOutliner class for consistency.

Still LGTM. And if it's just moving code around inside a file you authored, just do it without phabricator review. Post-commit review is fine.

Awesome, thanks!

MatzeB added inline comments.Jul 27 2017, 4:14 PM
lib/CodeGen/MachineOutliner.cpp
1060–1062

OUTLINED is fine a made a typo.
My point was to do << "AB" instead of << "A" << "B"

paquette marked an inline comment as done.Jul 27 2017, 4:18 PM
paquette added inline comments.
lib/CodeGen/MachineOutliner.cpp
1060–1062

Ah, okay! It's silly that it wasn't that before. I'll fix that.

MatzeB closed this revision.Sep 26 2017, 2:34 PM

Looks like this was committed in r309334