This is an archive of the discontinued LLVM Phabricator instance.

[IRSim][IROutliner] Adding support for recognizing and outlining branches
AbandonedPublic

Authored by AndrewLitteken on Jul 21 2021, 7:17 AM.

Details

Reviewers
paquette
Summary

This adds support to both the IRSimilarityIdentifier and IROutliner to recognize similarity between branches. We consider two branches to be close to one another if they have the same number of potential branching locations. Within a region, we use the numbering method to determine if two branches contain the same values, but we also check to ensure that two corresponding branches:

  • Branch to an internal basic block to the region, or outside basic block to the region at the same time
  • Branch to the same relative block location if targeting an internal branch

When outlining blocks, we have special handling if our multiple exit approach splits any PHINodes. We have different rewrites rules that detect when this occurs, and make sure any values needed are propagated, and are included in the overall function.

Diff Detail

Event Timeline

AndrewLitteken created this revision.Jul 21 2021, 7:17 AM
AndrewLitteken requested review of this revision.Jul 21 2021, 7:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2021, 7:17 AM
AndrewLitteken added inline comments.Jul 21 2021, 9:33 AM
llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
130

Comments needed

150

Comments needed

529

Add comments, or convert to method

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

Not needed anymore

1300

Remove debugging statements

AndrewLitteken abandoned this revision.Jul 28 2021, 12:50 PM

closing to replace with smaller patches