This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GlobalISel] Select source modifiers for VOP3Opsel
AbandonedPublic

Authored by mbrkusanin on Jan 20 2022, 2:34 AM.

Details

Diff Detail

Event Timeline

mbrkusanin created this revision.Jan 20 2022, 2:34 AM
mbrkusanin requested review of this revision.Jan 20 2022, 2:34 AM
arsenm accepted this revision.Jan 20 2022, 10:53 AM
This revision is now accepted and ready to land.Jan 20 2022, 10:53 AM
foad accepted this revision.Jan 21 2022, 2:25 AM

LGTM, just minor comments.

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

Not sure, but it might be cleaner to return Register (and return Register() on failure)?

3400

Don't need the outermost parens on this line?

foad added inline comments.Jan 21 2022, 2:44 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3693

Since you are stripping bitcasts, don't you need the same kind of type check as in D116441, to make sure it is a 16-bit fneg?

3698

Likewise.

  • Refactor and updated isExtractHiElt function
  • Extracted work done in one iteration for selecting modifiers into a separate function so it can be used in selectVOP3NoMods. For same reason, parts that only look through instructions are separated and done before any code that selects source modifiers.
  • Added type checks in a lot of cases.
mbrkusanin added inline comments.Jan 26 2022, 10:20 AM
llvm/test/CodeGen/AMDGPU/GlobalISel/vop3-op-sel.ll
101–106

We should make combines for eliminating these. selectVOP3NoMods currently prevents this from being vop2 but other instructions would not have been eliminated otherwise.

mbrkusanin requested review of this revision.Feb 3 2022, 3:20 AM
arsenm added inline comments.Feb 9 2022, 9:12 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3542

Braces and save type to variable instead of querying it a second time later

arsenm added inline comments.Feb 21 2022, 6:31 PM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
3666

Formatting

3669

Def can't fail

Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2022, 8:34 AM
Herald added a subscriber: kosarev. · View Herald Transcript
arsenm requested changes to this revision.Nov 16 2022, 3:47 PM
arsenm added a reviewer: Pierre-vh.

I think most of this is done, is there anything left to merge?

This revision now requires changes to proceed.Nov 16 2022, 3:47 PM
mbrkusanin abandoned this revision.Nov 18 2022, 6:35 AM

Nothing that I can see.