/
redgpu
/
ispc
Обзор
Документация
Войти
/
redgpu
/
ispc
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.20.0
src/opt/MakeInternalFuncsStatic.h
35 строк
1 KB
Dmitry Babokin
Remove the phrase "All rights reserved."
01 апр 2023, 03:48
01 апр 2023, 03:48
33bd2b4
Код
Авторство
О чём код?
/* Copyright (c) 2022-2023, Intel Corporation SPDX-License-Identifier: BSD-3-Clause */ #pragma once #include "ISPCPass.h" namespace ispc { /** There are a number of target-specific functions that we use during these optimization passes. By the time we are done with optimization, any uses of these should be inlined and no calls to these functions should remain. This pass marks all of these functions as having private linkage so that subsequent passes can eliminate them as dead code, thus cleaning up the final code output by the compiler. We can't just declare these as static from the start, however, since then they end up being eliminated as dead code during early optimization passes even though we may need to generate calls to them during later optimization passes. */ class MakeInternalFuncsStaticPass : public llvm::ModulePass { public: static char ID; explicit MakeInternalFuncsStaticPass() : ModulePass(ID) {} void getAnalysisUsage(llvm::AnalysisUsage &AU) const override { AU.setPreservesCFG(); } llvm::StringRef getPassName() const override { return "Make internal funcs \"static\""; } bool runOnModule(llvm::Module &m) override; }; llvm::Pass *CreateMakeInternalFuncsStaticPass(); } // namespace ispc