[IROutliner] Deduplicating functions that only require inputs.
authorAndrew Litteken <andrew.litteken@gmail.com>
Thu, 27 Aug 2020 20:16:37 +0000 (15:16 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Sat, 19 Dec 2020 23:34:34 +0000 (17:34 -0600)
commit7c6f28a438b59dea11a7fc2562b3389874c58112
treee2509a8ea5ab6ac093537be92c544ea6ef584259
parentb8a2b6af374e9dca3ad320fcffd8798c0170801f
[IROutliner] Deduplicating functions that only require inputs.

Extracted regions can have both inputs and outputs.  In addition, the
CodeExtractor removes inputs that are only used in llvm.assumes, and
sunken allocas (values are used entirely in the extracted region as
denoted by lifetime intrinsics).  We also cannot combine sections that
have different constants in the same structural location, and these
constants will have to elevated to argument. This patch deduplicates
extracted functions that only have inputs and non of the special cases.

We test that correctly deduplicate in:
test/Transforms/IROutliner/outlining-same-globals.ll
test/Transforms/IROutliner/outlining-same-constants.ll
test/Transforms/IROutliner/outlining-different-structure.ll

Reviewers: jroelofs, paquette

Differential Revision: https://reviews.llvm.org/D86978
21 files changed:
llvm/include/llvm/Transforms/IPO/IROutliner.h
llvm/lib/Transforms/IPO/IROutliner.cpp
llvm/test/Transforms/IROutliner/extraction.ll
llvm/test/Transforms/IROutliner/illegal-assumes.ll
llvm/test/Transforms/IROutliner/illegal-branches.ll
llvm/test/Transforms/IROutliner/illegal-callbr.ll
llvm/test/Transforms/IROutliner/illegal-calls.ll
llvm/test/Transforms/IROutliner/illegal-catchpad.ll
llvm/test/Transforms/IROutliner/illegal-cleanup.ll
llvm/test/Transforms/IROutliner/illegal-frozen.ll
llvm/test/Transforms/IROutliner/illegal-gep.ll
llvm/test/Transforms/IROutliner/illegal-invoke.ll
llvm/test/Transforms/IROutliner/illegal-landingpad.ll
llvm/test/Transforms/IROutliner/illegal-memset.ll
llvm/test/Transforms/IROutliner/illegal-phi-nodes.ll
llvm/test/Transforms/IROutliner/legal-debug.ll
llvm/test/Transforms/IROutliner/outlining-address-taken.ll
llvm/test/Transforms/IROutliner/outlining-different-constants.ll
llvm/test/Transforms/IROutliner/outlining-different-structure.ll
llvm/test/Transforms/IROutliner/outlining-same-constants.ll
llvm/test/Transforms/IROutliner/outlining-same-globals.ll