[IRSim][IROutliner] Adding the extraction basics for the IROutliner.
authorAndrew Litteken <andrew.litteken@gmail.com>
Tue, 15 Sep 2020 23:05:38 +0000 (18:05 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Thu, 17 Dec 2020 17:27:26 +0000 (11:27 -0600)
commitdae34463e3e05a055899b65251efde887a24ec38
treed6a115047b75a54b7ef84a7a98f3a4b527eb1f32
parentc1f30e581793f8db889b6fad0c3860f163f4afa2
[IRSim][IROutliner] Adding the extraction basics for the IROutliner.

Extracting the similar regions is the first step in the IROutliner.

Using the IRSimilarityIdentifier, we collect the SimilarityGroups and
sort them by how many instructions will be removed.  Each
IRSimilarityCandidate is used to define an OutlinableRegion.  Each
region is ordered by their occurrence in the Module and the regions that
are not compatible with previously outlined regions are discarded.

Each region is then extracted with the CodeExtractor into its own
function.

We test that correctly extract in:
test/Transforms/IROutliner/extraction.ll
test/Transforms/IROutliner/address-taken.ll
test/Transforms/IROutliner/outlining-same-globals.ll
test/Transforms/IROutliner/outlining-same-constants.ll
test/Transforms/IROutliner/outlining-different-structure.ll

Recommit of bf899e891387d07dfd12de195ce2a16f62afd5e0 fixing memory
leaks.

Reviewers: paquette, jroelofs, yroux

Differential Revision: https://reviews.llvm.org/D86975
14 files changed:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/IPO.h
llvm/include/llvm/Transforms/IPO/IROutliner.h [new file with mode: 0644]
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/IPO/CMakeLists.txt
llvm/lib/Transforms/IPO/IPO.cpp
llvm/lib/Transforms/IPO/IROutliner.cpp [new file with mode: 0644]
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/test/Transforms/IROutliner/extraction.ll [new file with mode: 0644]
llvm/test/Transforms/IROutliner/outlining-address-taken.ll [new file with mode: 0644]
llvm/test/Transforms/IROutliner/outlining-different-structure.ll [new file with mode: 0644]
llvm/test/Transforms/IROutliner/outlining-same-constants.ll [new file with mode: 0644]
llvm/test/Transforms/IROutliner/outlining-same-globals.ll [new file with mode: 0644]