Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
Signed-off-by: Sidorov, Dmitry <[email protected]>
  • Loading branch information
MrSidims committed Oct 16, 2024
1 parent ce69ac7 commit 0de7ccb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
switch (ExtInst->getExtSetKind()) {
case SPIRVEIS_OpenCL: {
auto *V = mapValue(BV, transOCLBuiltinFromExtInst(ExtInst, BB));
applyFPFastMathModeDecorations(BV, static_cast<Instruction*>(V));
applyFPFastMathModeDecorations(BV, static_cast<Instruction *>(V));
return V;
}
case SPIRVEIS_Debug:
Expand Down
9 changes: 5 additions & 4 deletions lib/SPIRV/SPIRVWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3068,16 +3068,17 @@ bool LLVMToSPIRVBase::transDecoration(Value *V, SPIRVValue *BV) {
}
// Handle nofpclass attribute. Nothing to do if fast math flag is already
// set.
if ((BV->isExtInst() && static_cast<SPIRVExtInst *>(
BV)->getExtSetKind() == SPIRVEIS_OpenCL) &&
if ((BV->isExtInst() &&
static_cast<SPIRVExtInst *>(BV)->getExtSetKind() ==
SPIRVEIS_OpenCL) &&
BM->isAllowedToUseVersion(VersionNumber::SPIRV_1_6) &&
!(M & FPFastMathModeFastMask)) {
auto *F = cast<CallInst>(V)->getCalledFunction();
auto FAttrs = F->getAttributes();
AttributeSet RetAttrs = FAttrs.getRetAttrs();
if (RetAttrs.hasAttribute(Attribute::NoFPClass)) {
FPClassTest RetTest = RetAttrs.getAttribute(
Attribute::NoFPClass).getNoFPClass();
FPClassTest RetTest =
RetAttrs.getAttribute(Attribute::NoFPClass).getNoFPClass();
AttributeSet RetAttrs = FAttrs.getRetAttrs();
// Only Nan and Inf tests are representable in SPIR-V now.
bool ToAddNoNan = RetTest & fcNan;
Expand Down

0 comments on commit 0de7ccb

Please sign in to comment.