[PATCH] D94303: Adapting to hoisted bitcasts in CodeExtractor

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 06:34:59 PST 2021


AndrewLitteken created this revision.
AndrewLitteken added reviewers: paquette, plotfi, vsk, ggeorgakoudis.
Herald added a subscriber: hiraditya.
AndrewLitteken requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In commit 700d2417d8281ea56dfd7ac72d1a1473d03d2d59 <https://reviews.llvm.org/rG700d2417d8281ea56dfd7ac72d1a1473d03d2d59> the CodeExtractor was updated so that bitcasts that have lifetime markers that beginning outside of the region are deduplicated outside the region and are not used as an output.  This caused a discrepancy in the IROutliner, where in these cases there were arguments added to the aggregate function that were not needed causing assertion errors.

The IROutliner queries the CodeExtractor twice to determine the inputs and outputs, before and after `findAllocas` is called with the same ValueSet for the outputs causing the duplication. This has been fixed with a dummy ValueSet for the first call.

However, the additional bitcasts prevent us from using the same similarity relationships that were previously defined by the IR Similarity Analysis Pass. In these cases, we check whether the initial version of the region being analyzed for outlining is still the same as it was previously.  If it is not, i.e. because of the additional bitcast instructions from the CodeExtractor, we discard the region.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94303

Files:
  llvm/lib/Transforms/IPO/IROutliner.cpp
  llvm/test/Transforms/IROutliner/outlining-bitcasts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94303.315378.patch
Type: text/x-patch
Size: 5958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210108/77df5a9d/attachment.bin>


More information about the llvm-commits mailing list