This is an archive of the discontinued LLVM Phabricator instance.

[IRSim] Letting gep instructions be legal for similarity identification.
ClosedPublic

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

Details

Reviewers
paquette
jroelofs
Summary

GetElementPtr instructions require the extra check that all operands after the first must only be constants and be exactly the same to be considered similar.

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

Diff Detail

Event Timeline

AndrewLitteken created this revision.Sep 8 2020, 11:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2020, 11:45 AM
AndrewLitteken requested review of this revision.Sep 8 2020, 11:45 AM
jroelofs accepted this revision.Sep 14 2020, 5:21 PM
jroelofs added a subscriber: jroelofs.

LGTM

llvm/lib/Analysis/IRSimilarityIdentifier.cpp
47

auto *GEP is probably appropriate here, if you want, since the type name gets repeated.

57

Likewise, I'd probably auto these, since the type of the iterator isn't super important to make visible. I think this is a grey area when it comes to community preference, so either way is fine, and I'll leave it up to you.

This revision is now accepted and ready to land.Sep 14 2020, 5:21 PM