[clang] [llvm] [RFC][WIP][AMDGPU] Use `bf16` instead of `i16` for bfloat (PR #80908)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 11:45:43 PST 2024


================
@@ -1562,8 +1562,9 @@ bool IRTranslator::translateBitCast(const User &U,
 
 bool IRTranslator::translateCast(unsigned Opcode, const User &U,
                                  MachineIRBuilder &MIRBuilder) {
-  if (U.getType()->getScalarType()->isBFloatTy() ||
-      U.getOperand(0)->getType()->getScalarType()->isBFloatTy())
+  if (Opcode != TargetOpcode::G_BITCAST &&
----------------
shiltian wrote:

I think bitcast can still be supported even if we don't know how to convert from bfloat to other types mentioned in #71470. If so, we might want a separate patch for this.

https://github.com/llvm/llvm-project/pull/80908


More information about the cfe-commits mailing list