Skip to content

Commit

Permalink
[refactor] Remove unnecessary parameter of irpass::scalarize (#7087)
Browse files Browse the repository at this point in the history
Issue: #7002
  • Loading branch information
PGZXB authored Jan 9, 2023
1 parent b523daf commit 539d2a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion taichi/ir/transforms.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace irpass {
void re_id(IRNode *root);
void flag_access(IRNode *root);
void eliminate_immutable_local_vars(IRNode *root);
void scalarize(IRNode *root, const CompileConfig &config);
void scalarize(IRNode *root);
void lower_matrix_ptr(IRNode *root);
bool die(IRNode *root);
bool simplify(IRNode *root, const CompileConfig &config);
Expand Down
4 changes: 2 additions & 2 deletions taichi/transforms/compile_to_offloads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void compile_to_offloads(IRNode *ir,
print("Immutable local vars eliminated");

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

// Remove redundant MatrixInitStmt inserted during scalarization
irpass::die(ir);
Expand Down Expand Up @@ -342,7 +342,7 @@ void compile_function(IRNode *ir,
}

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

// Remove redundant MatrixInitStmt inserted during scalarization
irpass::die(ir);
Expand Down
2 changes: 1 addition & 1 deletion taichi/transforms/scalarize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ class ExtractLocalPointers : public BasicStmtVisitor {

namespace irpass {

void scalarize(IRNode *root, const CompileConfig &config) {
void scalarize(IRNode *root) {
TI_AUTO_PROF;
Scalarize scalarize_pass(root);
auto scalarizable_allocas = GatherScalarizableLocalPointers::run(root);
Expand Down
8 changes: 4 additions & 4 deletions tests/cpp/transforms/scalarize_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST(Scalarize, ScalarizeGlobalStore) {

block->push_back<GlobalStoreStmt>(dest_stmt, matrix_init_stmt);

irpass::scalarize(block.get(), test_prog.prog()->this_thread_config());
irpass::scalarize(block.get());
irpass::lower_matrix_ptr(block.get());
irpass::die(block.get());

Expand Down Expand Up @@ -100,7 +100,7 @@ TEST(Scalarize, ScalarizeGlobalLoad) {
// Without this GlobalStoreStmt, nothing survives irpass::die()
block->push_back<GlobalStoreStmt>(src_stmt, load_stmt);

irpass::scalarize(block.get(), test_prog.prog()->this_thread_config());
irpass::scalarize(block.get());
irpass::lower_matrix_ptr(block.get());
irpass::die(block.get());

Expand Down Expand Up @@ -160,7 +160,7 @@ TEST(Scalarize, ScalarizeLocalStore) {
// LocalStoreStmt survives irpass::die()
block->push_back<LocalStoreStmt>(dest_stmt, matrix_init_stmt);

irpass::scalarize(block.get(), test_prog.prog()->this_thread_config());
irpass::scalarize(block.get());
irpass::die(block.get());

EXPECT_EQ(block->size(), 2 /*const*/ + 4 /*alloca*/ + 4 /*store*/);
Expand Down Expand Up @@ -207,7 +207,7 @@ TEST(Scalarize, ScalarizeLocalLoad) {
// Without this GlobalStoreStmt, nothing survives irpass::die()
block->push_back<GlobalStoreStmt>(src_stmt, load_stmt);

irpass::scalarize(block.get(), test_prog.prog()->this_thread_config());
irpass::scalarize(block.get());
irpass::die(block.get());

EXPECT_EQ(block->size(), 4 /*alloca*/ + 4 /*load*/ + 4 /*store*/);
Expand Down

0 comments on commit 539d2a5

Please sign in to comment.