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
183–221

this needs Doxygen comments

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

comment?

110

comment on the loop?

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

add in-code comments to the loop?

195

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

197

needs comments?

273

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

281

Is there a more succinct way to compute this?

345–346

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.