Skip to content

Commit

Permalink
[AMDGPU][CodeGen] Support raw format TFE buffer loads other than byte…
Browse files Browse the repository at this point in the history
…, short and d16 ones.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D138215
  • Loading branch information
kosarev committed Dec 19, 2022
1 parent 5ddce70 commit 85dada8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4548,19 +4548,22 @@ bool AMDGPULegalizerInfo::legalizeBufferLoad(MachineInstr &MI,

// TODO: Support TFE for typed and narrow loads.
if (IsTyped) {
assert(!IsTFE);
if (IsTFE)
return false;
Opc = IsD16 ? AMDGPU::G_AMDGPU_TBUFFER_LOAD_FORMAT_D16 :
AMDGPU::G_AMDGPU_TBUFFER_LOAD_FORMAT;
} else if (IsFormat) {
if (IsD16) {
assert(!IsTFE);
if (IsTFE)
return false;
Opc = AMDGPU::G_AMDGPU_BUFFER_LOAD_FORMAT_D16;
} else {
Opc = IsTFE ? AMDGPU::G_AMDGPU_BUFFER_LOAD_FORMAT_TFE
: AMDGPU::G_AMDGPU_BUFFER_LOAD_FORMAT;
}
} else {
assert(!IsTFE);
if (IsTFE)
return false;
switch (MemTy.getSizeInBits()) {
case 8:
Opc = AMDGPU::G_AMDGPU_BUFFER_LOAD_UBYTE;
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4894,7 +4894,8 @@ SDValue SITargetLowering::lowerIntrinsicLoad(MemSDNode *M, bool IsFormat,
: AMDGPUISD::BUFFER_LOAD_FORMAT;
} else {
// TODO: Support non-format TFE loads.
assert(!IsTFE);
if (IsTFE)
return SDValue();
Opc = AMDGPUISD::BUFFER_LOAD;
}

Expand Down

0 comments on commit 85dada8

Please sign in to comment.