[PATCH] D87296: [IRSim][IROutliner] Adding support for consolidating functions with different output arguments.

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 10:08:17 PDT 2020


AndrewLitteken created this revision.
AndrewLitteken added a reviewer: paquette.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
AndrewLitteken requested review of this revision.

Certain regions can have values introduced inside the region that are used outside of the region.  These may not be the same for each similar region, so we must create one over arching set of arguments for the consolidated function.

We do this by iterating over the outputs for each extracted function, and creating as many different arguments to encapsulate the different outputs sets.  For each output set, we create a different block with the necessary stores from the value to the output register.  There is then one switch statement, controlled by an argument to the function, to differentiate which block to use.

Changed Tests for consistency:

- 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

Tests to test new functionality:

- llvm/test/Transforms/IROutliner/outlining-different-output-blocks.ll
- llvm/test/Transforms/IROutliner/outlining-remapped-outputs.ll
- llvm/test/Transforms/IROutliner/outlining-same-output-blocks.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87296

Files:
  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-different-output-blocks.ll
  llvm/test/Transforms/IROutliner/outlining-remapped-outputs.ll
  llvm/test/Transforms/IROutliner/outlining-same-output-blocks.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87296.290520.patch
Type: text/x-patch
Size: 61140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200908/f75ed8b4/attachment.bin>


More information about the llvm-commits mailing list