This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Refactor the artifact combiner a bit by using MIPatternMatch
ClosedPublic

Authored by volkan on Nov 5 2018, 11:36 AM.

Diff Detail

Event Timeline

volkan created this revision.Nov 5 2018, 11:36 AM
include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
89

Looks like this patch is not NFC (Is it meant to be?). Looks like the check for isInstUnsupported has been dropped here. Is that intended?

volkan updated this revision to Diff 172628.Nov 5 2018, 11:45 AM

Added the missing legality check.

volkan marked an inline comment as done.Nov 5 2018, 11:46 AM
volkan added inline comments.
include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
89

It was not, I updated the patch.

Thanks. With this patch, are there any more users of getOpcodeDef? If not, we should probably remove that helper.

volkan marked an inline comment as done.Nov 5 2018, 11:51 AM

Thanks. With this patch, are there any more users of getOpcodeDef? If not, we should probably remove that helper.

Yes, it is used by tryFoldImplicitDef and tryCombineMerges. We can remove it once we have matchers for G_IMPLICIT_DEF and G_MERGE_VALUES.

Ok. LGTM. Thanks for cleaning this up.

This revision is now accepted and ready to land.Nov 5 2018, 12:00 PM
This revision was automatically updated to reflect the committed changes.