[PATCH] D122206: [IROutliner] Ensure that phi values that are passed in as arguments are remapped as arguments

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 20:35:17 PDT 2022


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

Issue: https://github.com/llvm/llvm-project/issues/54430

For incoming values of phi nodes added to an outlined function to accommodate different exit paths in the function, when a value is a constant that is passed into the outlined function as an argument, we find the corresponding value in the first extracted function used to fill the overall outlined function.  When this value is an argument, the corresponding value used will be the old value, prior to outlining.  This patch maintains a mapping from these values to arguments, and uses this mapping to update the added phi node accordingly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122206

Files:
  llvm/include/llvm/Transforms/IPO/IROutliner.h
  llvm/lib/Transforms/IPO/IROutliner.cpp
  llvm/test/Transforms/IROutliner/exit-phi-nodes-incoming-value-constant-argument.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122206.417173.patch
Type: text/x-patch
Size: 5782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220322/5b45a590/attachment.bin>


More information about the llvm-commits mailing list