This is an archive of the discontinued LLVM Phabricator instance.

[IRSim][IROutliner] Allowing call instructions to be outlined.
ClosedPublic

Authored by AndrewLitteken on Sep 8 2020, 11:44 AM.

Details

Summary

We add an extra check to make sure that we do not outline calls to indirect functions, but outline whatever the IRSimilarityIdentifier finds with respect to calls.

Tests:

  • Removing test/Transforms/IROutliner/illegal-calls.ll
  • Adding test/Transforms/IROutliner/outlining-calls.ll
  • Adding test/Transforms/IROutliner/illegal-indirect-calls.ll

Diff Detail

Event Timeline

AndrewLitteken created this revision.Sep 8 2020, 11:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2020, 11:44 AM
AndrewLitteken requested review of this revision.Sep 8 2020, 11:44 AM
jroelofs added inline comments.
llvm/include/llvm/Transforms/IPO/IROutliner.h
248

I don't follow the logic behind needing a name for this to work. ISTM you could pass the callee pointer as another new arg, and everything else would Just Work (TM). What am I missing?

AndrewLitteken added inline comments.Sep 14 2020, 6:07 PM
llvm/include/llvm/Transforms/IPO/IROutliner.h
248

I don’t think you’re missing anything on that front. I just hadn’t considered writing it like that before. The same name just ensures that we are outlining the exact same function in both cases without any sort of argument handling, if it’s indirect, we can’t guarantee that.

However I think that it might be best to handle indirect calls in a separate patch later on since it adds a layer of complexity onto handling the arguments (see https://reviews.llvm.org/D87294 for an example of how it would be handled).

jroelofs accepted this revision.Sep 15 2020, 10:15 AM

LGTM

llvm/include/llvm/Transforms/IPO/IROutliner.h
248

👍

This revision is now accepted and ready to land.Sep 15 2020, 10:15 AM
This revision was landed with ongoing or failed builds.Dec 31 2020, 9:30 PM
This revision was automatically updated to reflect the committed changes.