[codegen] [liveness] bugfix in live range computation

This commit is contained in:
Philippe Tillet
2019-10-18 14:54:26 -04:00
parent cfde3dd766
commit 50efd9c82f
5 changed files with 17 additions and 18 deletions

View File

@@ -37,16 +37,16 @@ void liveness::run(ir::module &mod) {
if(layout->type != SHARED)
continue;
// users
std::set<ir::value*> users;
std::set<ir::user*> users;
for(ir::value *v: layout->values){
users.insert(v);
for(ir::user *u: v->get_users())
users.insert(u);
}
// compute intervals
unsigned start = INT32_MAX;
unsigned end = 0;
for(ir::value *u: users){
for(ir::user *u: users)
if(indices.find(u) != indices.end()){
start = std::min(start, indices.at(u));
end = std::max(end, indices.at(u));
}

View File

@@ -231,11 +231,10 @@ std::unique_ptr<driver::module> function::make_bin(ir::module &module, driver::c
align.run(module);
dce.run(module);
reassociate.run(module);
dce.run(module);
cts.run(module);
dce.run(module);
align.run(module);
axes.run(module);
// ir::print(module, std::cout);
layouts.run(module);
liveness.run(module);
allocation.run(module);

View File

@@ -11,17 +11,17 @@ int main() {
// shapes to benchmark
typedef std::tuple<std::vector<int>, std::vector<int>, std::vector<int>> config_t;
std::vector<config_t> configs = {
// {{4096*4096}, {0}, {0}},
{{4096*4096}, {0}, {0}},
{{4096, 4096}, {0, 1}, {1, 0}},
// {{4096, 4096}, {0, 1}, {1, 0}},
// {{4096, 4096}, {1, 0}, {0, 1}},
// {{4096, 4096}, {0, 1}, {0, 1}},
// {{256, 256, 256}, {0, 1, 2}, {0, 1, 2}},
// {{256, 256, 256}, {0, 1, 2}, {0, 2, 1}},
// {{256, 256, 256}, {1, 0, 2}, {1, 2, 0}},
// {{256, 256, 256}, {1, 2, 0}, {1, 0, 2}},
// {{256, 256, 256}, {2, 0, 1}, {0, 1, 2}},
// {{256, 256, 256}, {2, 1, 0}, {0, 2, 1}}
{{4096, 4096}, {0, 1}, {1, 0}},
{{4096, 4096}, {1, 0}, {0, 1}},
{{4096, 4096}, {0, 1}, {0, 1}},
{{256, 256, 256}, {0, 1, 2}, {0, 1, 2}},
{{256, 256, 256}, {0, 1, 2}, {0, 2, 1}},
{{256, 256, 256}, {1, 0, 2}, {1, 2, 0}},
{{256, 256, 256}, {1, 2, 0}, {1, 0, 2}},
{{256, 256, 256}, {2, 0, 1}, {0, 1, 2}},
{{256, 256, 256}, {2, 1, 0}, {0, 2, 1}}
};
// does the work
std::vector<int32_t> shape;

View File

@@ -13,7 +13,7 @@ int main() {
for(auto x: std::vector<std::array<bool, 2>>{{false, false}, {false, true},
{true, false}, {true, true}}){
std::vector<config_t> tmp = {
config_t{ord, x[0], x[1], 2048, 2048, 2048},
config_t{ord, x[0], x[1], 4096, 4096, 4096},
// config_t{ord, x[0], x[1], 16, 2048, 2048},
// config_t{ord, x[0], x[1], 32, 2048, 2048},
// config_t{ord, x[0], x[1], 64, 2048, 2048},

View File

@@ -12,8 +12,8 @@ int main() {
std::vector<config_t> configs;
for(int TM: std::vector<int>{32, 64})
for(int TN: std::vector<int>{32, 64})
for(int TK: std::vector<int>{8})
for(int nwarps: std::vector<int>{8})
for(int TK: std::vector<int>{16})
for(int nwarps: std::vector<int>{4})
for(bool AT: std::array<bool, 2>{false, true})
for(bool BT: std::array<bool, 2>{false, true}){
configs.push_back(config_t{FLOAT, AT, BT, 128, 128, 128, TM, TN, TK, nwarps});