This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Move V_FMA_MIX pattern matching into tablegen. NFC
ClosedPublic

Authored by bogner on Feb 22 2023, 5:52 PM.

Details

Summary

The matching for V_FMA_MIX was partially implemented with a C++
matcher (for fmas with 32 bit results and 16 bit inputs) and partially
in tablegen (for fmas with 16 bit results). Move the C++ matcher logic
into tablegen to make this more consistent and so we can remove the
duplication between SDAG and GISel.

Diff Detail

Event Timeline

bogner created this revision.Feb 22 2023, 5:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2023, 5:52 PM
bogner requested review of this revision.Feb 22 2023, 5:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2023, 5:52 PM
arsenm accepted this revision.Feb 22 2023, 6:06 PM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
548–552

This is losing the assert but this probably shouldn't be an assert in the first place, maybe could be a verifier check

This revision is now accepted and ready to land.Feb 22 2023, 6:06 PM
foad added a comment.Feb 23 2023, 2:07 AM

Looks like a great cleanup, thanks!

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
555

Is it worth preserving the TODO somewhere?

bogner marked an inline comment as done.Feb 23 2023, 10:25 AM
bogner added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
555

I added a TODO about handling of denormals in general in the version I pushed.