-
Notifications
You must be signed in to change notification settings - Fork 64
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
1 parent
fca22ce
commit 44be88c
Showing
30 changed files
with
240 additions
and
86 deletions.
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
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 |
---|---|---|
@@ -1,19 +1,35 @@ | ||
#pragma once | ||
|
||
#include "luisa/xir/basic_block.h" | ||
|
||
#include <luisa/xir/instruction.h> | ||
|
||
namespace luisa::compute::xir { | ||
|
||
class BasicBlock; | ||
|
||
class BranchInst : public Instruction { | ||
|
||
private: | ||
BasicBlock *_true_block = nullptr; | ||
BasicBlock *_false_block = nullptr; | ||
class LC_XIR_API BranchInst : public Instruction { | ||
|
||
public: | ||
explicit BranchInst(Pool *pool, | ||
Value *cond = nullptr, | ||
BasicBlock *true_block = nullptr, | ||
BasicBlock *false_block = nullptr, | ||
BasicBlock *parent_block = nullptr, | ||
const Name *name = nullptr) noexcept; | ||
|
||
void set_cond(Value *cond) noexcept; | ||
void set_true_block(BasicBlock *block) noexcept; | ||
void set_false_block(BasicBlock *block) noexcept; | ||
|
||
[[nodiscard]] Value *cond() noexcept; | ||
[[nodiscard]] const Value *cond() const noexcept; | ||
|
||
[[nodiscard]] BasicBlock *true_block() noexcept; | ||
[[nodiscard]] const BasicBlock *true_block() const noexcept; | ||
|
||
[[nodiscard]] BasicBlock *false_block() noexcept; | ||
[[nodiscard]] const BasicBlock *false_block() const noexcept; | ||
}; | ||
|
||
}// namespace luisa::compute::xir |
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 |
---|---|---|
@@ -1,9 +1,27 @@ | ||
#pragma once | ||
|
||
#include <luisa/core/stl/filesystem.h> | ||
#include <luisa/xir/metadata.h> | ||
|
||
namespace luisa::compute::xir { | ||
|
||
class LC_XIR_API LocationMD : public Metadata { | ||
|
||
private: | ||
luisa::filesystem::path _file; | ||
int _line; | ||
int _column; | ||
|
||
} | ||
public: | ||
explicit LocationMD(Pool *pool, | ||
luisa::filesystem::path file = {}, | ||
int line = -1, int column = -1) noexcept; | ||
void set_file(luisa::filesystem::path file) noexcept { _file = std::move(file); } | ||
void set_line(int line) noexcept { _line = line; } | ||
void set_column(int column) noexcept { _column = column; } | ||
[[nodiscard]] auto &file() const noexcept { return _file; } | ||
[[nodiscard]] auto line() const noexcept { return _line; } | ||
[[nodiscard]] auto column() const noexcept { return _column; } | ||
}; | ||
|
||
}// namespace luisa::compute::xir |
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
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
Oops, something went wrong.