Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

[IRSim] Letting call instructions be legal for similarity identification.

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



Here we let non-intrinsic calls be considered legal and valid for similarity only if the call is not indirect, and has a name.

For two calls to be considered similar, they must have the same name, the same function types, and the same set of parameters, including tail calls and calling conventions.

Tests are found in unittests/Analysis/IRSimilarityIdentifierTest.cpp.

Diff Detail

Event Timeline

AndrewLitteken created this revision.Sep 8 2020, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2020, 11:41 AM
jroelofs added inline comments.

Maybe you ought to have a test that exercises the indirect call case, since getCalledFunction() will return nullptr for that.

Might also be useful to define a short helper function that extracts the name, since you'll be repeating the same logic twice for A/B.

Helper functions and nullptr checking for Call Instructions.

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



static StringRef


could sink the assert into the helper, which dedupes this a bit more.


same what?

This revision is now accepted and ready to land.Sep 15 2020, 10:13 AM