Skip to content

[AMDGPU] Add v2bf16 for opsel immediate folding #82435

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

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

rampitec
Copy link
Collaborator

This was previously enabled since v2bf16 was represented by v2f16. As of now it is NFC since we only have dot instructions which could use it, but currently folding is guarded by the hasDOTOpSelHazard().

This was previously enabled since v2bf16 was represented by v2f16.
As of now it is NFC since we only have dot instructions which could
use it, but currently folding is guarded by the hasDOTOpSelHazard().
@llvmbot
Copy link
Member

llvmbot commented Feb 20, 2024

@llvm/pr-subscribers-backend-amdgpu

Author: Stanislav Mekhanoshin (rampitec)

Changes

This was previously enabled since v2bf16 was represented by v2f16. As of now it is NFC since we only have dot instructions which could use it, but currently folding is guarded by the hasDOTOpSelHazard().


Full diff: https://github.com/llvm/llvm-project/pull/82435.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIFoldOperands.cpp (+2)
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index 8bf05682cbe7ea..d16d8ebd41a54f 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -219,8 +219,10 @@ bool SIFoldOperands::canUseImmWithOpSel(FoldCandidate &Fold) const {
   default:
     return false;
   case AMDGPU::OPERAND_REG_IMM_V2FP16:
+  case AMDGPU::OPERAND_REG_IMM_V2BF16:
   case AMDGPU::OPERAND_REG_IMM_V2INT16:
   case AMDGPU::OPERAND_REG_INLINE_C_V2FP16:
+  case AMDGPU::OPERAND_REG_INLINE_C_V2BF16:
   case AMDGPU::OPERAND_REG_INLINE_C_V2INT16:
     break;
   }

Copy link
Contributor

@shiltian shiltian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@rampitec rampitec merged commit 39cab1a into llvm:main Feb 20, 2024
@rampitec rampitec deleted the bf16-opsel-folding branch February 20, 2024 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants