Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions lib/SPIRV/SPIRVWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4276,20 +4276,6 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
// -spirv-allow-unknown-intrinsics work correctly.
auto IID = II->getIntrinsicID();
switch (IID) {
case Intrinsic::fabs:
case Intrinsic::fma:
case Intrinsic::maxnum:
case Intrinsic::minnum:
case Intrinsic::fmuladd: {
Type *Ty = II->getType();
if (Ty->isBFloatTy())
BM->addCapability(internal::CapabilityBFloat16ArithmeticINTEL);
break;
}
default:
break;
}
switch (IID) {
case Intrinsic::assume: {
// llvm.assume translation is currently supported only within
// SPV_KHR_expect_assume extension, ignore it otherwise, since it's
Expand Down Expand Up @@ -5721,11 +5707,6 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI,
SmallVector<std::string, 2> Dec;
if (isBuiltinTransToExtInst(CI->getCalledFunction(), &ExtSetKind, &ExtOp,
&Dec)) {
if (const auto *FirstArg = F->getArg(0)) {
const auto *Type = FirstArg->getType();
if (Type->isBFloatTy())
BM->addCapability(internal::CapabilityBFloat16ArithmeticINTEL);
}
if (DemangledName.find("__spirv_ocl_printf") != StringRef::npos) {
auto *FormatStrPtr = cast<PointerType>(CI->getArgOperand(0)->getType());
if (FormatStrPtr->getAddressSpace() !=
Expand Down
4 changes: 0 additions & 4 deletions lib/SPIRV/libSPIRV/SPIRVModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1739,8 +1739,6 @@ SPIRVInstruction *SPIRVModuleImpl::addBinaryInst(Op TheOpCode, SPIRVType *Type,
SPIRVValue *Op1,
SPIRVValue *Op2,
SPIRVBasicBlock *BB) {
if (Type->isTypeFloat(16, FPEncodingBFloat16KHR) && TheOpCode != OpDot)
addCapability(internal::CapabilityBFloat16ArithmeticINTEL);
return addInstruction(SPIRVInstTemplateBase::create(
TheOpCode, Type, getId(),
getVec(Op1->getId(), Op2->getId()), BB, this),
Expand All @@ -1764,8 +1762,6 @@ SPIRVInstruction *
SPIRVModuleImpl::addUnaryInst(Op TheOpCode, SPIRVType *TheType, SPIRVValue *Op,
SPIRVBasicBlock *BB,
SPIRVInstruction *InsertBefore) {
if (TheType->isTypeFloat(16, FPEncodingBFloat16KHR) && TheOpCode != OpDot)
addCapability(internal::CapabilityBFloat16ArithmeticINTEL);
return addInstruction(
SPIRVInstTemplateBase::create(TheOpCode, TheType, getId(),
getVec(Op->getId()), BB, this),
Expand Down