Skip to content

Conversation

@jmmartinez
Copy link
Contributor

Update if condition to match the use of the targetSupportsBF16Type helper.

@llvmbot
Copy link
Member

llvmbot commented Nov 12, 2025

@llvm/pr-subscribers-llvm-globalisel

Author: Juan Manuel Martinez Caamaño (jmmartinez)

Changes

Update if condition to match the use of the targetSupportsBF16Type helper.


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

1 Files Affected:

  • (modified) llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp (+1-1)
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index d656f1071400d..53c831b203cae 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -3482,7 +3482,7 @@ bool IRTranslator::translateAtomicCmpXchg(const User &U,
 
 bool IRTranslator::translateAtomicRMW(const User &U,
                                       MachineIRBuilder &MIRBuilder) {
-  if (!MF->getTarget().getTargetTriple().isSPIRV() && containsBF16Type(U))
+  if (containsBF16Type(U) && !targetSupportsBF16Type(MF))
     return false;
 
   const AtomicRMWInst &I = cast<AtomicRMWInst>(U);

@jmmartinez jmmartinez changed the title [NFC][SPIRV][IRTranslator] Replace lefotver isSSPIRV() with targetSupportsBF16Type [NFC][SPIRV][IRTranslator] Replace leftover MF->getTarget().getTargetTriple().isSPIRV() with targetSupportsBF16Type(MF) Nov 12, 2025
@jmmartinez jmmartinez changed the title [NFC][SPIRV][IRTranslator] Replace leftover MF->getTarget().getTargetTriple().isSPIRV() with targetSupportsBF16Type(MF) [NFC][SPIRV][IRTranslator] Replace leftover MF->getTarget().getTargetTriple().isSPIRV() with targetSupportsBF16Type(MF) Nov 12, 2025
Copy link
Member

@jsji jsji left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@jmmartinez jmmartinez merged commit 5b56816 into main Nov 12, 2025
12 checks passed
@jmmartinez jmmartinez deleted the users/jmmartinez/clean/leftover_is_spirv_use branch November 12, 2025 16:59
git-crd pushed a commit to git-crd/crd-llvm-project that referenced this pull request Nov 13, 2025
…tTriple().isSPIRV() ` with `targetSupportsBF16Type(MF)` (llvm#167704)
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.

4 participants