Skip to content

Commit

Permalink
[Lang] Migrate irpass::scalarize() after irpass::detect_read_only()
Browse files Browse the repository at this point in the history
  • Loading branch information
jim19930609 committed May 6, 2023
1 parent 4447d48 commit e7b3921
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions taichi/transforms/compile_to_offloads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ void compile_to_offloads(IRNode *ir,
irpass::full_simplify(ir, config, {false, /*autodiff_enabled*/ false});
print("Simplified III");
irpass::analysis::verify(ir);

if (config.real_matrix_scalarize) {
irpass::scalarize(ir);

// Remove redundant MatrixInitStmt inserted during scalarization
irpass::full_simplify(ir, config, {false, /*autodiff_enabled*/ false});
print("Scalarized");
}
}

void offload_to_executable(IRNode *ir,
Expand Down Expand Up @@ -187,6 +179,14 @@ void offload_to_executable(IRNode *ir,
print("Detect read-only accesses");
}

if (config.real_matrix_scalarize) {
irpass::scalarize(ir);

// Remove redundant MatrixInitStmt inserted during scalarization
irpass::full_simplify(ir, config, {false, /*autodiff_enabled*/ false});
print("Scalarized");
}

irpass::demote_atomics(ir, config);
print("Atomics demoted I");
irpass::analysis::verify(ir);
Expand Down

0 comments on commit e7b3921

Please sign in to comment.