Page MenuHomePhabricator

[IRSim][IROutliner] Detecting Similar Phi Nodes and Outlining
ClosedPublic

Authored by AndrewLitteken on Jul 28 2021, 1:13 PM.

Details

Summary

We use the same similarity scheme we used for branch instructions for phi nodes, and allow them to be outlined. There is not a lot of special handling needed for these phi nodes when outlining, as they simply act as outputs. The code extractor does not currently allow for non entry blocks within the extracted region to have predecessors, so there are not conflicts to handle with respect to predecessors no longer contained in the function.

Diff Detail

Event Timeline

AndrewLitteken created this revision.Jul 28 2021, 1:13 PM
AndrewLitteken requested review of this revision.Jul 28 2021, 1:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 1:13 PM

Updating to handle changes from previous commits, more thorough testing, and bug fixes for outlining PHINodes.

AndrewLitteken added inline comments.Sep 16 2021, 9:41 AM
llvm/lib/Transforms/IPO/IROutliner.cpp
185 ↗(On Diff #370301)

this needs Doxygen comments

paquette added inline comments.Dec 20 2021, 11:56 AM
llvm/lib/Analysis/IRSimilarityIdentifier.cpp
55

comment?

93

comment on the loop?

llvm/lib/Transforms/IPO/IROutliner.cpp
189 ↗(On Diff #370301)

add in-code comments to the loop?

197 ↗(On Diff #370301)

since Term is only used for computing BI, it might as well be folded in here.

199 ↗(On Diff #370301)

needs comments?

260 ↗(On Diff #370301)

"original beginning go the branch instruction" doesn't make a lot of sense?

268 ↗(On Diff #370301)

Is there a more succinct way to compute this?

336 ↗(On Diff #370301)

Remove this?

Updating based on comments

This revision is now accepted and ready to land.Jan 12 2022, 1:59 PM
This revision was landed with ongoing or failed builds.Jan 25 2022, 4:27 PM
This revision was automatically updated to reflect the committed changes.