|
| 1 | +diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp |
| 2 | +index d363f060a..28f83d661 100644 |
| 3 | +--- a/lib/SPIRV/SPIRVWriter.cpp |
| 4 | ++++ b/lib/SPIRV/SPIRVWriter.cpp |
| 5 | +@@ -4211,20 +4211,6 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II, |
| 6 | + // -spirv-allow-unknown-intrinsics work correctly. |
| 7 | + auto IID = II->getIntrinsicID(); |
| 8 | + switch (IID) { |
| 9 | +- case Intrinsic::fabs: |
| 10 | +- case Intrinsic::fma: |
| 11 | +- case Intrinsic::maxnum: |
| 12 | +- case Intrinsic::minnum: |
| 13 | +- case Intrinsic::fmuladd: { |
| 14 | +- Type *Ty = II->getType(); |
| 15 | +- if (Ty->isBFloatTy()) |
| 16 | +- BM->addCapability(internal::CapabilityBFloat16ArithmeticINTEL); |
| 17 | +- break; |
| 18 | +- } |
| 19 | +- default: |
| 20 | +- break; |
| 21 | +- } |
| 22 | +- switch (IID) { |
| 23 | + case Intrinsic::assume: { |
| 24 | + // llvm.assume translation is currently supported only within |
| 25 | + // SPV_KHR_expect_assume extension, ignore it otherwise, since it's |
| 26 | +@@ -5508,11 +5494,6 @@ SPIRVValue *LLVMToSPIRVBase::transDirectCallInst(CallInst *CI, |
| 27 | + SmallVector<std::string, 2> Dec; |
| 28 | + if (isBuiltinTransToExtInst(CI->getCalledFunction(), &ExtSetKind, &ExtOp, |
| 29 | + &Dec)) { |
| 30 | +- if (const auto *FirstArg = F->getArg(0)) { |
| 31 | +- const auto *Type = FirstArg->getType(); |
| 32 | +- if (Type->isBFloatTy()) |
| 33 | +- BM->addCapability(internal::CapabilityBFloat16ArithmeticINTEL); |
| 34 | +- } |
| 35 | + if (DemangledName.find("__spirv_ocl_printf") != StringRef::npos) { |
| 36 | + auto *FormatStrPtr = cast<PointerType>(CI->getArgOperand(0)->getType()); |
| 37 | + if (FormatStrPtr->getAddressSpace() != |
| 38 | +diff --git a/lib/SPIRV/libSPIRV/SPIRVModule.cpp b/lib/SPIRV/libSPIRV/SPIRVModule.cpp |
| 39 | +index a680574ec..2ff1df097 100644 |
| 40 | +--- a/lib/SPIRV/libSPIRV/SPIRVModule.cpp |
| 41 | ++++ b/lib/SPIRV/libSPIRV/SPIRVModule.cpp |
| 42 | +@@ -1732,8 +1732,6 @@ SPIRVInstruction *SPIRVModuleImpl::addBinaryInst(Op TheOpCode, SPIRVType *Type, |
| 43 | + SPIRVValue *Op1, |
| 44 | + SPIRVValue *Op2, |
| 45 | + SPIRVBasicBlock *BB) { |
| 46 | +- if (Type->isTypeFloat(16, FPEncodingBFloat16KHR) && TheOpCode != OpDot) |
| 47 | +- addCapability(internal::CapabilityBFloat16ArithmeticINTEL); |
| 48 | + return addInstruction(SPIRVInstTemplateBase::create( |
| 49 | + TheOpCode, Type, getId(), |
| 50 | + getVec(Op1->getId(), Op2->getId()), BB, this), |
| 51 | +@@ -1757,8 +1755,6 @@ SPIRVInstruction *SPIRVModuleImpl::addUnaryInst(Op TheOpCode, |
| 52 | + SPIRVType *TheType, |
| 53 | + SPIRVValue *Op, |
| 54 | + SPIRVBasicBlock *BB) { |
| 55 | +- if (TheType->isTypeFloat(16, FPEncodingBFloat16KHR) && TheOpCode != OpDot) |
| 56 | +- addCapability(internal::CapabilityBFloat16ArithmeticINTEL); |
| 57 | + return addInstruction( |
| 58 | + SPIRVInstTemplateBase::create(TheOpCode, TheType, getId(), |
| 59 | + getVec(Op->getId()), BB, this), |
0 commit comments