[PATCH] D87294: [IRSim][IROutliner] Adding support for elevating constants that are not the same in each region to arguments

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 09:53:22 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.

When there are constants that have the same structural location, but not the same value, between different regions, we cannot simply outline the region.  Instead, we find the constants that are not the same in each location, and promote them to arguments to be passed into the respective functions.  At each call site, we pass the constant in as an argument regardless of type.

Added/Edited Tests:

- llvm/test/Transforms/IROutliner/outlining-constants-vs-registers.ll
- llvm/test/Transforms/IROutliner/outlining-different-constants.ll
- llvm/test/Transforms/IROutliner/outlining-different-globals.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87294

Files:
  llvm/include/llvm/Transforms/IPO/IROutliner.h
  llvm/lib/Transforms/IPO/IROutliner.cpp
  llvm/test/Transforms/IROutliner/outlining-constants-vs-registers.ll
  llvm/test/Transforms/IROutliner/outlining-different-constants.ll
  llvm/test/Transforms/IROutliner/outlining-different-globals.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87294.290514.patch
Type: text/x-patch
Size: 24072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200908/02e520b2/attachment.bin>


More information about the llvm-commits mailing list