Skip to content

Commit 7f126e1

Browse files
committed
remove dead omp code
1 parent ffbfd68 commit 7f126e1

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

llvm/lib/Transforms/IPO/OpenMPOpt.cpp

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,39 +5906,19 @@ bool llvm::omp::isOpenMPKernel(Function &Fn) {
59065906
}
59075907

59085908
KernelSet llvm::omp::getDeviceKernels(Module &M) {
5909-
// TODO: Create a more cross-platform way of determining device kernels.
59105909
KernelSet Kernels;
59115910

5912-
DenseSet<const Function *> SeenKernels;
5913-
auto ProcessKernel = [&](Function &KF) {
5914-
if (SeenKernels.insert(&KF).second) {
5911+
for (Function &F : M)
5912+
if (F.hasKernelCallingConv()) {
59155913
// We are only interested in OpenMP target regions. Others, such as
59165914
// kernels generated by CUDA but linked together, are not interesting to
59175915
// this pass.
5918-
if (isOpenMPKernel(KF)) {
5916+
if (isOpenMPKernel(F)) {
59195917
++NumOpenMPTargetRegionKernels;
5920-
Kernels.insert(&KF);
5918+
Kernels.insert(&F);
59215919
} else
59225920
++NumNonOpenMPTargetRegionKernels;
59235921
}
5924-
};
5925-
5926-
if (NamedMDNode *MD = M.getNamedMetadata("nvvm.annotations"))
5927-
for (auto *Op : MD->operands()) {
5928-
if (Op->getNumOperands() < 2)
5929-
continue;
5930-
MDString *KindID = dyn_cast<MDString>(Op->getOperand(1));
5931-
if (!KindID || KindID->getString() != "kernel")
5932-
continue;
5933-
5934-
if (auto *KernelFn =
5935-
mdconst::dyn_extract_or_null<Function>(Op->getOperand(0)))
5936-
ProcessKernel(*KernelFn);
5937-
}
5938-
5939-
for (Function &F : M)
5940-
if (F.hasKernelCallingConv())
5941-
ProcessKernel(F);
59425922

59435923
return Kernels;
59445924
}

0 commit comments

Comments
 (0)