Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opt] Fix CFGNode::store_to_load_forwarding data type #1283

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion taichi/ir/control_flow_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ bool CFGNode::store_to_load_forwarding(bool after_lower_access) {
if (result) {
if (result->is<AllocaStmt>()) {
// special case of alloca (initialized to 0)
auto zero = Stmt::make<ConstStmt>(LaneAttribute<TypedConstant>(0));
auto zero =
Stmt::make<ConstStmt>(TypedConstant(result->ret_type.data_type, 0));
stmt->replace_with(zero.get());
erase(i);
insert(std::move(zero), i);
Expand Down