2021-06-11 22:06:44 +01:00
|
|
|
/* -*- C++ -*-
|
2021-10-12 20:51:03 +01:00
|
|
|
* Serene Programming Language
|
2021-06-11 22:06:44 +01:00
|
|
|
*
|
2023-02-06 17:40:45 +00:00
|
|
|
* Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
|
2021-06-11 22:06:44 +01:00
|
|
|
*
|
2021-10-12 20:51:03 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 2.
|
2021-06-11 22:06:44 +01:00
|
|
|
*
|
2021-10-12 20:51:03 +01:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2021-06-11 22:06:44 +01:00
|
|
|
*
|
2021-10-12 20:51:03 +01:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2021-06-11 22:06:44 +01:00
|
|
|
*/
|
2021-06-13 22:58:46 +01:00
|
|
|
|
2021-06-17 13:19:19 +01:00
|
|
|
#ifndef SERENE_PASSES_H
|
|
|
|
#define SERENE_PASSES_H
|
|
|
|
|
2022-04-27 21:49:57 +01:00
|
|
|
#include "serene/export.h"
|
|
|
|
|
2021-06-11 22:06:44 +01:00
|
|
|
#include <mlir/Pass/Pass.h>
|
|
|
|
|
2022-06-02 15:19:31 +01:00
|
|
|
#define PASS_LOG(...) \
|
|
|
|
DEBUG_WITH_TYPE("PASSES", llvm::dbgs() << __VA_ARGS__ << "\n");
|
|
|
|
|
2021-06-11 22:06:44 +01:00
|
|
|
namespace serene::passes {
|
|
|
|
|
2022-04-27 21:49:57 +01:00
|
|
|
/// Return a pass to lower the serene.symbol op
|
|
|
|
SERENE_EXPORT std::unique_ptr<mlir::Pass> createLowerSymbol();
|
|
|
|
|
|
|
|
SERENE_EXPORT void registerAllPasses();
|
2021-10-06 18:48:48 +01:00
|
|
|
/// Return a pass to convert SLIR dialect to built-in dialects
|
|
|
|
/// of MLIR.
|
|
|
|
std::unique_ptr<mlir::Pass> createSLIRLowerToMLIRPass();
|
|
|
|
|
|
|
|
/// Return a pass to convert different dialects of MLIR to LLVM dialect.
|
2021-06-17 13:19:19 +01:00
|
|
|
std::unique_ptr<mlir::Pass> createSLIRLowerToLLVMDialectPass();
|
2021-06-11 22:06:44 +01:00
|
|
|
|
|
|
|
} // namespace serene::passes
|
2021-06-17 13:19:19 +01:00
|
|
|
|
|
|
|
#endif
|