This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SDAG: Improve {extract,insert}_subvector lowering for 16-bit vectors
ClosedPublic

Authored by nhaehnle on May 4 2023, 4:40 AM.

Diff Detail

Event Timeline

nhaehnle created this revision.May 4 2023, 4:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 4:40 AM
nhaehnle requested review of this revision.May 4 2023, 4:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 4:40 AM
Herald added a subscriber: wdng. · View Herald Transcript
foad added inline comments.May 4 2023, 4:48 AM
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1440

Start != 1 is redundant now.

nhaehnle updated this revision to Diff 519450.May 4 2023, 5:18 AM

How about this? :)

nhaehnle updated this revision to Diff 519454.May 4 2023, 5:37 AM

More test changes

Joe_Nash accepted this revision.May 4 2023, 7:44 AM
Joe_Nash added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1440

I'm not sure the Start == NumElt case will ever be hit.
But it looks like that can be removed in a follow up patch anyway.
LGTM

This revision is now accepted and ready to land.May 4 2023, 7:44 AM
nhaehnle added inline comments.May 4 2023, 7:50 AM
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1440

It's an extract, so Start == NumElt should mean that we're extracting the high half of the source vector. Unless I'm extremely confused right now.

arsenm accepted this revision.May 4 2023, 7:54 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1440

I think this is one of those cases that theoretically exists but is really hard to observe since the combiner would always just fold it to the source operand

Joe_Nash added inline comments.May 4 2023, 7:56 AM
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1440

Oh, you are right. I was doing NumElt->NumSrcElt in my head