forked from llvm/clangir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//====- LowerToSPIRV.h- Lowering from CIR to LLVM -------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file declares an interface for converting MLIR modules to SPIR-V | ||
// | ||
//===----------------------------------------------------------------------===// | ||
#ifndef CLANG_CIR_LOWERTOSPIRV_H | ||
#define CLANG_CIR_LOWERTOSPIRV_H | ||
|
||
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" | ||
|
||
#include <memory> | ||
|
||
namespace llvm { | ||
class LLVMContext; | ||
class Module; | ||
} // namespace llvm | ||
|
||
namespace mlir { | ||
class MLIRContext; | ||
class ModuleOp; | ||
|
||
spirv::ModuleOp lowerFromMLIRToSPIRV(mlir::ModuleOp theModule, | ||
mlir::MLIRContext *mlirCtx); | ||
} // namespace mlir | ||
|
||
#endif // CLANG_CIR_LOWERTOSPIRV_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "mlir/IR/BuiltinOps.h" | ||
#include "mlir/IR/MLIRContext.h" | ||
#include "mlir/Pass/PassManager.h" | ||
#include "clang/CIR/Passes.h" | ||
#include "llvm/Support/TimeProfiler.h" | ||
|
||
#include "mlir/Dialect/SPIRV/Transforms/Passes.h" | ||
|
||
namespace mlir { | ||
|
||
mlir::ModuleOp lowerFromMLIRToSPIRV(mlir::ModuleOp theModule, | ||
mlir::MLIRContext *mlirCtx) { | ||
llvm::TimeTraceScope scope("Lower from MLIR to SPIR-V"); | ||
|
||
mlir::PassManager pm(mlirCtx); | ||
|
||
// TODO | ||
//pm.addPass(cir::createConvertMLIRToSPIRVPass()); | ||
|
||
//auto result = !mlir::failed(pm.run(theModule)); | ||
//if (!result) | ||
// report_fatal_error("The pass manager failed to lower CIR to SPIRV dialect!"); | ||
} | ||
|
||
} // namespace mlir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters