[IRSim][IROutliner] Limit to extracting regions that only require
authorAndrew Litteken <andrew.litteken@gmail.com>
Thu, 3 Sep 2020 17:20:47 +0000 (12:20 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Sat, 19 Dec 2020 19:33:54 +0000 (13:33 -0600)
commitc52bcf3a9b2d3cd60e62f38218979b781ccc9d8a
tree01238aab7c94e86b6d5520600758a35ff2691a8e
parentf47b07315a3c308a214119244b216602c537a1b2
[IRSim][IROutliner] Limit to extracting regions 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 limits the
extracted regions to those that only require inputs, and do not have any
 other special cases.

We test that we do not outline the wrong constants in:
test/Transforms/IROutliner/outliner-different-constants.ll
test/Transforms/IROutliner/outliner-different-globals.ll
test/Transforms/IROutliner/outliner-constant-vs-registers.ll

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

Reviewers: paquette, plofti

Differential Revision: https://reviews.llvm.org/D86977
12 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-memcpy.ll
llvm/test/Transforms/IROutliner/illegal-memmove.ll
llvm/test/Transforms/IROutliner/illegal-vaarg.ll
llvm/test/Transforms/IROutliner/outlining-constants-vs-registers.ll [new file with mode: 0644]
llvm/test/Transforms/IROutliner/outlining-different-constants.ll [new file with mode: 0644]
llvm/test/Transforms/IROutliner/outlining-different-globals.ll [new file with mode: 0644]
llvm/test/Transforms/IROutliner/outlining-different-structure.ll
llvm/test/Transforms/IROutliner/outlining-same-constants.ll