-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[AMDGPU] Support arbitrary types in amdgcn.dead #134841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6629,6 +6629,11 @@ void SITargetLowering::ReplaceNodeResults(SDNode *N, | |
| Results.push_back(LoadVal); | ||
| return; | ||
| } | ||
| case Intrinsic::amdgcn_dead: { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need to handle this both here in
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| for (unsigned I = 0, E = N->getNumValues(); I < E; ++I) | ||
| Results.push_back(DAG.getPOISON(N->getValueType(I))); | ||
| return; | ||
| } | ||
| } | ||
| break; | ||
| } | ||
|
|
@@ -9115,6 +9120,12 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, | |
| case Intrinsic::amdgcn_mov_dpp8: | ||
| case Intrinsic::amdgcn_update_dpp: | ||
| return lowerLaneOp(*this, Op.getNode(), DAG); | ||
| case Intrinsic::amdgcn_dead: { | ||
| SmallVector<SDValue, 8> Poisons; | ||
| for (unsigned I = 0, E = Op.getNode()->getNumValues(); I != E; ++I) | ||
| Poisons.push_back(DAG.getPOISON(Op.getNode()->getValueType(I))); | ||
|
||
| return DAG.getMergeValues(Poisons, SDLoc(Op)); | ||
| } | ||
| default: | ||
| if (const AMDGPU::ImageDimIntrinsicInfo *ImageDimIntr = | ||
| AMDGPU::getImageDimIntrinsicInfo(IntrinsicID)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
| # RUN: llc -mtriple=amdgcn-amdpal -mcpu=gfx1200 -run-pass=legalizer %s -o - | FileCheck %s | ||
|
|
||
| --- | ||
| name: test_struct | ||
| body: | | ||
| bb.1.entry: | ||
|
|
||
| ; CHECK-LABEL: name: test_struct | ||
| ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF | ||
| ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(<3 x s32>) = G_IMPLICIT_DEF | ||
| ; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF | ||
| ; CHECK-NEXT: [[DEF3:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF | ||
| ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF1]](<3 x s32>) | ||
| ; CHECK-NEXT: $vgpr0 = COPY [[DEF]](s32) | ||
| ; CHECK-NEXT: $vgpr1 = COPY [[UV]](s32) | ||
| ; CHECK-NEXT: $vgpr2 = COPY [[UV1]](s32) | ||
| ; CHECK-NEXT: $vgpr3 = COPY [[UV2]](s32) | ||
| ; CHECK-NEXT: $vgpr4_vgpr5 = COPY [[DEF2]](s64) | ||
| ; CHECK-NEXT: $vgpr6 = COPY [[DEF3]](<2 x s16>) | ||
| ; CHECK-NEXT: SI_RETURN implicit $vgpr0, implicit $vgpr1, implicit $vgpr2, implicit $vgpr3, implicit $vgpr4, implicit $vgpr5, implicit $vgpr6, implicit $vgpr7 | ||
| %0:_(s32), %1:_(<3 x s32>), %2:_(s64), %3:_(<2 x s16>) = G_INTRINSIC intrinsic(@llvm.amdgcn.dead) | ||
|
|
||
| %4:_(s32), %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %1(<3 x s32>) | ||
| $vgpr0 = COPY %0(s32) | ||
| $vgpr1 = COPY %4(s32) | ||
| $vgpr2 = COPY %5(s32) | ||
| $vgpr3 = COPY %6(s32) | ||
| $vgpr4_vgpr5 = COPY %2(s64) | ||
| $vgpr6 = COPY %3(<2 x s16>) | ||
| SI_RETURN implicit $vgpr0, implicit $vgpr1, implicit $vgpr2, implicit $vgpr3, implicit $vgpr4, implicit $vgpr5, implicit $vgpr6, implicit $vgpr7 | ||
| ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this intrinsic get multiple defs in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can when we return a struct type.