Skip to content

Commit 8279f29

Browse files
committed
try
Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent e6d7d94 commit 8279f29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/SYCLLowerIR/SYCLSqrtFDivMaxErrorCleanUp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ SYCLSqrtFDivMaxErrorCleanUpPass::run(Module &M,
7676
}
7777
}
7878
}
79-
/*
8079
// No intrinsics at all - do an early exist.
8180
if (WorkListSqrt.empty() && WorkListFDiv.empty())
8281
return PreservedAnalyses::all();
@@ -88,21 +87,22 @@ SYCLSqrtFDivMaxErrorCleanUpPass::run(Module &M,
8887
continue;
8988
for (auto &BB : F) {
9089
for (auto &II : BB) {
91-
if (auto *CI = dyn_cast<CallInst>(&II)) {
90+
if (auto *CI = dyn_cast_or_null<CallInst>(&II)) {
9291
auto *SqrtF = CI->getCalledFunction();
9392
if (SqrtF->getName() == "sqrt" ||
9493
SqrtF->getName().starts_with("_Z4sqrt") ||
9594
SqrtF->getIntrinsicID() == llvm::Intrinsic::sqrt)
9695
return PreservedAnalyses::all();
9796
}
98-
if (auto *FPI = dyn_cast<FPMathOperator>(&II)) {
97+
if (auto *FPI = dyn_cast_or_null<FPMathOperator>(&II)) {
9998
auto Opcode = FPI->getOpcode();
10099
if (Opcode == Instruction::FDiv)
101100
return PreservedAnalyses::all();
102101
}
103102
}
104103
}
105104
}
105+
/*
106106
// Replace @llvm.fpbuiltin.sqrt call with @llvm.sqrt. llvm-spirv will handle
107107
// it later.
108108
SmallSet<Function *, 2> DeclToRemove;

0 commit comments

Comments
 (0)