Page MenuHomePhabricator

[IROutliner] Ensure that phi values that are passed in as arguments are remapped as arguments
ClosedPublic

Authored by AndrewLitteken on Mar 21 2022, 8:35 PM.

Details

Summary

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.

Diff Detail

Event Timeline

AndrewLitteken created this revision.Mar 21 2022, 8:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2022, 8:35 PM
AndrewLitteken requested review of this revision.Mar 21 2022, 8:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2022, 8:35 PM
paquette accepted this revision.Mar 25 2022, 9:38 AM

LGTM with nit on a comment

llvm/test/Transforms/IROutliner/exit-phi-nodes-incoming-value-constant-argument.ll
5

This sentence doesn't make sense?

This revision is now accepted and ready to land.Mar 25 2022, 9:38 AM
This revision was landed with ongoing or failed builds.Apr 14 2022, 10:16 AM
This revision was automatically updated to reflect the committed changes.