Skip to content

Commit 91971cc

Browse files
committed
indirect call check?
Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent 2c8c71e commit 91971cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/SYCLLowerIR/SYCLSqrtFDivMaxErrorCleanUp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ SYCLSqrtFDivMaxErrorCleanUpPass::run(Module &M,
8989
for (auto &II : BB) {
9090
if (auto *CI = dyn_cast<CallInst>(&II)) {
9191
auto *SqrtF = CI->getCalledFunction();
92+
if (!SqrtF)
93+
return PreservedAnalyses::all();
9294
if (SqrtF->getName() == "sqrt" ||
93-
SqrtF->getName().starts_with("_Z4sqrt"))
94-
// SqrtF->getIntrinsicID() == llvm::Intrinsic::sqrt)
95+
SqrtF->getName().starts_with("_Z4sqrt") ||
96+
SqrtF->getIntrinsicID() == llvm::Intrinsic::sqrt)
9597
return PreservedAnalyses::all();
9698
}
9799
if (auto *FPI = dyn_cast<FPMathOperator>(&II)) {
@@ -102,7 +104,6 @@ SYCLSqrtFDivMaxErrorCleanUpPass::run(Module &M,
102104
}
103105
}
104106
}
105-
/*
106107
// Replace @llvm.fpbuiltin.sqrt call with @llvm.sqrt. llvm-spirv will handle
107108
// it later.
108109
SmallSet<Function *, 2> DeclToRemove;
@@ -165,6 +166,5 @@ SYCLSqrtFDivMaxErrorCleanUpPass::run(Module &M,
165166
Decl->dropAllReferences();
166167
Decl->eraseFromParent();
167168
}
168-
*/
169169
return PreservedAnalyses::all();
170170
}

0 commit comments

Comments
 (0)