This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Use GlobalISel MatchTable Combiner Backend
ClosedPublic

Authored by Pierre-vh on Jun 26 2023, 4:57 AM.

Details

Summary

Use the new matchtable-based combiner backend for all AMDGPU combiners.
This drop-in from the user's perspective; there are no test changes, the new combiner behaves exactly like the old one.

Depends on D153757

NOTE: This would land iff D153757 (RFC) lands too.

Diff Detail

Event Timeline

Pierre-vh created this revision.Jun 26 2023, 4:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 4:57 AM
Pierre-vh requested review of this revision.Jun 26 2023, 4:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 4:57 AM
Pierre-vh edited the summary of this revision. (Show Details)Jun 26 2023, 5:04 AM
Pierre-vh added reviewers: arsenm, foad.
Pierre-vh added inline comments.Jun 27 2023, 5:38 AM
llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
22–23

Some small detail I'm unsure about: Should I put these in the GET_GICOMBINER_DEPS and also do a typedef of GIMatchTableExecutor to something like ClassNameBase ? That way users don't even need to know about the match table executor.

arsenm added inline comments.Jun 30 2023, 12:24 PM
llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
85

function_ref(I guess this was wrong before)

Pierre-vh marked an inline comment as done.Jul 4 2023, 2:50 AM
Pierre-vh added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
85

It doesn't work because of the lifetime of the function unfortunately, there's a segfault

Pierre-vh updated this revision to Diff 537019.Jul 4 2023, 3:01 AM
Pierre-vh marked an inline comment as done.

Rebase + comments

Pierre-vh updated this revision to Diff 537265.Jul 5 2023, 2:22 AM

Add missing setupMF call

Currently it's called on every call to combine() which is annoying. I'd prefer if we only instantiated everything once.
It's a cheap function though so I believe it's fine to start with.

I think when/if this all lands and the dust settles a bit, we need to remove CombinerInfo and replace it with something
closer to InstructionSelector, e.g. have a InstructionCombiner base class and instantiate it once.
It's a bigger refactor though so I think it's better to do it later to make the review stack less confusing.

arsenm accepted this revision.Jul 7 2023, 11:59 AM
This revision is now accepted and ready to land.Jul 7 2023, 11:59 AM
This revision was landed with ongoing or failed builds.Jul 11 2023, 2:27 AM
This revision was automatically updated to reflect the committed changes.