Skip to content

Commit

Permalink
[LLVM] Add support for DeclBufferNode
Browse files Browse the repository at this point in the history
`DeclBufferNode` was added recently in apache#12300, but support to traverse it in codegen_llvm was not added. Since this just stmt just declares a new buffer for a body of TIR, we just need to traverse the body to properly generate code for LLVM.
  • Loading branch information
quic-sanirudh committed Feb 23, 2023
1 parent a3b51f1 commit ed55eda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/target/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,11 @@ void CodeGenLLVM::VisitStmt_(const SeqStmtNode* op) {
}
}

void CodeGenLLVM::VisitStmt_(const DeclBufferNode* op) {
EmitDebugLocation(op);
VisitStmt(op->body);
}

void CodeGenLLVM::VisitStmt_(const EvaluateNode* op) {
EmitDebugLocation(op);
MakeValue(op->value);
Expand Down
1 change: 1 addition & 0 deletions src/target/llvm/codegen_llvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class CodeGenLLVM : public ExprFunctor<llvm::Value*(const PrimExpr&)>,
void VisitStmt_(const LetStmtNode* op) override;
void VisitStmt_(const SeqStmtNode* op) override;
void VisitStmt_(const EvaluateNode* op) override;
void VisitStmt_(const DeclBufferNode* op) override;

// Get constant string
llvm::Constant* GetConstString(const std::string& str);
Expand Down

0 comments on commit ed55eda

Please sign in to comment.