This is an archive of the discontinued LLVM Phabricator instance.

[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
187–225

this needs Doxygen comments

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

comment?

121

comment on the loop?

llvm/lib/Transforms/IPO/IROutliner.cpp
191

add in-code comments to the loop?

199

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

201

needs comments?

277

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

285

Is there a more succinct way to compute this?

349–350

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.