This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Make v8i16/v8f16 legal
ClosedPublic

Authored by rampitec on Jan 19 2022, 1:38 PM.

Diff Detail

Event Timeline

rampitec created this revision.Jan 19 2022, 1:38 PM
rampitec requested review of this revision.Jan 19 2022, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2022, 1:38 PM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec updated this revision to Diff 401420.Jan 19 2022, 3:19 PM
arsenm added inline comments.Jan 19 2022, 3:38 PM
llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll
1273–1282 ↗(On Diff #401420)

What happened here?

rampitec added inline comments.Jan 19 2022, 3:52 PM
llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll
1273–1282 ↗(On Diff #401420)

I believe this is the result of extract_subvector inserted by the extract_elt lowering for v8f16.

arsenm added inline comments.Jan 19 2022, 4:03 PM
llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll
1273–1282 ↗(On Diff #401420)

There's some special casing of other f16 vectors in LowerEXTRACT_SUBVECTOR which I would assume would follow for these

rampitec added inline comments.Jan 19 2022, 4:07 PM
llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll
1273–1282 ↗(On Diff #401420)

Thanks, found it. I will probably need to add special cases for v8 too.

rampitec added inline comments.Jan 19 2022, 4:22 PM
llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll
1273–1282 ↗(On Diff #401420)

Hm... I run into the dag lowering loop. Maybe I need to find another way to do extract_elt here, w/o extract_subvector.

foad added a comment.Jan 20 2022, 12:34 AM

Make v8i16/v8f16 legal

Why? (No particular objection to the patch.)

Make v8i16/v8f16 legal

Why? (No particular objection to the patch.)

There are upcoming intrinsics to use it. Without a legal type these would use custom lowering.

rampitec updated this revision to Diff 402052.Jan 21 2022, 11:20 AM
rampitec marked an inline comment as done.

Custom lowering for vector_shuffle.

llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll
1273–1282 ↗(On Diff #401420)

Well, it was missing custom lowering for vector_shuffle.

arsenm accepted this revision.Jan 21 2022, 11:25 AM
This revision is now accepted and ready to land.Jan 21 2022, 11:25 AM
rampitec updated this revision to Diff 402260.Jan 22 2022, 1:58 PM

Added missing types to SReg_128. Found with debug tblgen build.

rampitec updated this revision to Diff 402286.Jan 22 2022, 9:35 PM
  • Added extract_subvector custom lowering which was missing.
  • Added extract_subvector patterns for sub0_sub1 and sub2_sub3.
  • Switched extract_elt to use cast to v2i64 for splitting instead of extract_subvector to avoid dag lowering loop.

PSDB passed.

This revision was landed with ongoing or failed builds.Jan 24 2022, 11:51 AM
This revision was automatically updated to reflect the committed changes.