diff options
Diffstat (limited to 'src/transformations')
-rw-r--r-- | src/transformations/loop.cc | 68 | ||||
-rw-r--r-- | src/transformations/loop_basic.cc | 58 | ||||
-rw-r--r-- | src/transformations/loop_datacopy.cc | 16 | ||||
-rw-r--r-- | src/transformations/loop_extra.cc | 4 | ||||
-rw-r--r-- | src/transformations/loop_tile.cc | 20 | ||||
-rw-r--r-- | src/transformations/loop_unroll.cc | 18 |
6 files changed, 92 insertions, 92 deletions
diff --git a/src/transformations/loop.cc b/src/transformations/loop.cc index 10dc7bb..d34f415 100644 --- a/src/transformations/loop.cc +++ b/src/transformations/loop.cc @@ -501,7 +501,7 @@ bool Loop::init_loop(std::vector<ir_tree_node *> &ir_tree, exp2formula(ir, r, f_root, freevar, ub, v, 's', cond, true, uninterpreted_symbols[i], uninterpreted_symbols_stringrepr[i]); else - throw ir_error("loop condition not supported"); + throw chill::error::ir("loop condition not supported"); if ((ir->QueryExpOperation(lp->lower_bound()) @@ -550,12 +550,12 @@ bool Loop::init_loop(std::vector<ir_tree_node *> &ir_tree, exp2formula(ir, r, f_root, freevar, ub, v, 's', IR_COND_LT, true, uninterpreted_symbols[i], uninterpreted_symbols_stringrepr[i]); else - throw ir_error("loop condition not supported"); + throw chill::error::ir("loop condition not supported"); vars_to_be_reversed.push_back(lp->index()->name()); } else - throw ir_error("loop step size zero"); - } catch (const ir_error &e) { + throw chill::error::ir("loop step size zero"); + } catch (const chill::error::ir &e) { actual_code[loc] = static_cast<IR_Block *>(ir_stmt[loc]->content)->extract(); for (int i = 0; i < itn->children.size(); i++) @@ -604,7 +604,7 @@ bool Loop::init_loop(std::vector<ir_tree_node *> &ir_tree, exp2constraint(ir, r, f_and, freevar, cond, true, uninterpreted_symbols[i], uninterpreted_symbols_stringrepr[i]); } - } catch (const ir_error &e) { + } catch (const chill::error::ir&e) { std::vector<ir_tree_node *> *t; if (itn->parent == NULL) t = &ir_tree; @@ -1104,17 +1104,17 @@ int Loop::get_dep_dim_of(int stmt_num, int level) const { if (level < 1) return -1; if (level > stmt[stmt_num].loop_level.size()) - throw loop_error("incorrect loop level information for statement " + throw chill::error::loop("incorrect loop level information for statement " + to_string(stmt_num)); break; default: - throw loop_error( + throw chill::error::loop( "unknown loop level information for statement " + to_string(stmt_num)); } trip_count++; if (trip_count >= stmt[stmt_num].loop_level.size()) - throw loop_error( + throw chill::error::loop( "incorrect loop level information for statement " + to_string(stmt_num)); } @@ -1406,7 +1406,7 @@ int Loop::getLexicalOrder(int stmt_num, int level) const { } } - throw loop_error( + throw chill::error::loop( "can't find lexical order for statement " + to_string(stmt_num) + "'s loop level " + to_string(level)); } @@ -1579,7 +1579,7 @@ void update_successors(int n, int m = i->first; if (node_num[m] != -1) - throw loop_error("Graph input for fusion has cycles not a DAG!!"); + throw chill::error::loop("Graph input for fusion has cycles not a DAG!!"); std::vector<bool> check_ = g.getEdge(n, m); @@ -1690,7 +1690,7 @@ Graph<std::set<int>, bool> Loop::construct_induced_graph_at_level( && dvs[k].has_been_carried_at(dep_dim))) { if (is_connected_i_to_j || has_true_edge_i_to_j) - throw loop_error( + throw chill::error::loop( "Graph input for fusion has cycles not a DAG!!"); if (dvs[k].is_data_dependence() @@ -1784,7 +1784,7 @@ std::vector<std::set<int> > Loop::typed_fusion(Graph<std::set<int>, bool> g, if (work_list.empty() || (s2.size() != g.vertex.size())) { std::cout << s2.size() << "\t" << g.vertex.size() << std::endl; - throw loop_error("Input for fusion not a DAG!!"); + throw chill::error::loop("Input for fusion not a DAG!!"); } @@ -1816,9 +1816,9 @@ std::vector<std::set<int> > Loop::typed_fusion(Graph<std::set<int>, bool> g, try { update_successors(n, node_num, cant_fuse_with, g, work_list, type_list, types); - } catch (const loop_error &e) { + } catch (const chill::error::loop&e) { - throw loop_error( + throw chill::error::loop( "statements cannot be fused together due to negative dependence"); } @@ -1845,9 +1845,9 @@ std::vector<std::set<int> > Loop::typed_fusion(Graph<std::set<int>, bool> g, try { update_successors(n, node_num, cant_fuse_with, g, work_list, type_list, types); - } catch (const loop_error &e) { + } catch (const chill::error::loop&e) { - throw loop_error( + throw chill::error::loop( "statements cannot be fused together due to negative dependence"); } @@ -1863,9 +1863,9 @@ std::vector<std::set<int> > Loop::typed_fusion(Graph<std::set<int>, bool> g, try { update_successors(n, node_num, cant_fuse_with, g, work_list, type_list, types); - } catch (const loop_error &e) { + } catch (const chill::error::loop&e) { - throw loop_error( + throw chill::error::loop( "statements cannot be fused together due to negative dependence"); } @@ -2030,7 +2030,7 @@ void Loop::setLexicalOrder(int dim, const std::set<int> &active, std::vector<std::set<int> > s = g.topoSort(); if (s.size() != g.vertex.size()) - throw loop_error( + throw chill::error::loop( "cannot separate statements with different loop types at loop level " + to_string(level)); @@ -2973,7 +2973,7 @@ void Loop::scalar_expand(int stmt_num, const std::vector<int> &levels, break; } default: - throw loop_error("unsupported array index expression"); + throw chill::error::loop("unsupported array index expression"); } } if ((*ei).get_const() != 0) @@ -3026,7 +3026,7 @@ void Loop::scalar_expand(int stmt_num, const std::vector<int> &levels, ub_list.push_back(*gi); } if (lb_list.size() == 0 || ub_list.size() == 0) - throw loop_error("failed to calcuate array footprint size"); + throw chill::error::loop("failed to calcuate array footprint size"); // build lower bound representation std::vector<CG_outputRepr *> lb_repr_list; @@ -3069,7 +3069,7 @@ void Loop::scalar_expand(int stmt_num, const std::vector<int> &levels, break; } default: - throw loop_error( + throw chill::error::loop( "cannot calculate temporay array size statically"); } } @@ -3093,7 +3093,7 @@ void Loop::scalar_expand(int stmt_num, const std::vector<int> &levels, break; } default: - throw loop_error( + throw chill::error::loop( "cannot calculate temporay array size statically"); } } @@ -3201,7 +3201,7 @@ void Loop::scalar_expand(int stmt_num, const std::vector<int> &levels, break; } default: - throw loop_error( + throw chill::error::loop( "failed to generate array index bound code"); } } @@ -3625,7 +3625,7 @@ void Loop::scalar_expand(int stmt_num, const std::vector<int> &levels, CG_outputRepr *temp = tmp_array_ref->convert()->clone(); if (ir->QueryExpOperation(stmt[stmt_num].code) != IR_OP_PLUS_ASSIGNMENT) - throw ir_error( + throw chill::error::ir( "Statement is not a += accumulation statement"); fprintf(stderr, "replacing in a +=\n"); @@ -3723,7 +3723,7 @@ void Loop::scalar_expand(int stmt_num, const std::vector<int> &levels, CG_outputRepr *temp = tmp_ptr_array_ref->convert()->clone(); if (ir->QueryExpOperation(stmt[stmt_num].code) != IR_OP_PLUS_ASSIGNMENT) - throw ir_error( + throw chill::error::ir( "Statement is not a += accumulation statement"); stmt[newStmt_num].code = ir->builder()->CreatePlusAssignment(0, temp->clone(), rhs); @@ -4056,7 +4056,7 @@ std::set<std::string> inspect_loop_bounds(IR_Code *ir, const Relation &R, std::map<std::string, std::vector<omega::CG_outputRepr *> > &uninterpreted_symbols) { if (!R.is_set()) - throw loop_error("Input R has to be a set not a relation!"); + throw chill::error::loop("Input R has to be a set not a relation!"); std::set<std::string> vars; @@ -4108,7 +4108,7 @@ CG_outputRepr *create_counting_loop_body(IR_Code *ir, const Relation &R, std::map<std::string, std::vector<omega::CG_outputRepr *> > &uninterpreted_symbols) { if (!R.is_set()) - throw loop_error("Input R has to be a set not a relation!"); + throw chill::error::loop("Input R has to be a set not a relation!"); CG_outputRepr *ub, *lb; ub = NULL; @@ -4133,7 +4133,7 @@ CG_outputRepr *create_counting_loop_body(IR_Code *ir, const Relation &R, if ((*gi).get_coef(v) > 0) { if (ub != NULL) - throw ir_error( + throw chill::error::ir( "bound expression too complex!"); ub = ir->builder()->CreateInvoke(s, @@ -4143,7 +4143,7 @@ CG_outputRepr *create_counting_loop_body(IR_Code *ir, const Relation &R, } else { if (lb != NULL) - throw ir_error( + throw chill::error::ir( "bound expression too complex!"); lb = ir->builder()->CreateInvoke(s, uninterpreted_symbols.find(s)->second); @@ -4191,7 +4191,7 @@ std::map<std::string, std::vector<std::string> > recurse_on_exp_for_arrays( IR_PointerArrayRef *ref_ = dynamic_cast<IR_PointerArrayRef *>(ir->Repr2Ref(exp)); if (ref == NULL && ref_ == NULL) - throw loop_error("Array symbol unidentifiable!"); + throw chill::error::loop("Array symbol unidentifiable!"); if (ref != NULL) { std::vector<std::string> s0; @@ -4204,7 +4204,7 @@ std::map<std::string, std::vector<std::string> > recurse_on_exp_for_arrays( for (std::map<std::string, std::vector<std::string> >::iterator j = a0.begin(); j != a0.end(); j++) { if (j->second.size() != 1 && (j->second)[0] != "") - throw loop_error( + throw chill::error::loop( "indirect array references not allowed in guard!"); s.push_back(j->first); } @@ -4223,7 +4223,7 @@ std::map<std::string, std::vector<std::string> > recurse_on_exp_for_arrays( for (std::map<std::string, std::vector<std::string> >::iterator j = a0.begin(); j != a0.end(); j++) { if (j->second.size() != 1 && (j->second)[0] != "") - throw loop_error( + throw chill::error::loop( "indirect array references not allowed in guard!"); s.push_back(j->first); } @@ -4404,7 +4404,7 @@ std::vector<std::string> construct_iteration_order( if (s == arrays[k]) found = true; if (!found) - throw loop_error("guard condition not solvable"); + throw chill::error::loop("guard condition not solvable"); } } else { bool found = false; diff --git a/src/transformations/loop_basic.cc b/src/transformations/loop_basic.cc index 1be0981..1afb9be 100644 --- a/src/transformations/loop_basic.cc +++ b/src/transformations/loop_basic.cc @@ -115,7 +115,7 @@ void Loop::permute(int stmt_num, int level, const std::vector<int> &pi) { if (min_dep_dim > max_dep_dim) return; if (max_dep_dim - min_dep_dim + 1 != t.size()) - throw loop_error("cannot update the dependence graph after permuation"); + throw chill::error::loop("cannot update the dependence graph after permuation"); std::vector<int> dep_pi(dep.num_dim()); for (int i = 0; i < min_dep_dim; i++) dep_pi[i] = i; @@ -157,7 +157,7 @@ void Loop::permute(int stmt_num, int level, const std::vector<int> &pi) { break; } default: - throw loop_error("unknown dependence type"); + throw chill::error::loop("unknown dependence type"); } } g.connect(i, j->first, dv); @@ -183,7 +183,7 @@ void Loop::permute(int stmt_num, int level, const std::vector<int> &pi) { case DEP_CONTROL: break; default: - throw loop_error("unknown dependence type"); + throw chill::error::loop("unknown dependence type"); } g.connect(i, j->first, dv); } @@ -217,7 +217,7 @@ void Loop::permute(int stmt_num, int level, const std::vector<int> &pi) { break; } default: - throw loop_error( + throw chill::error::loop( "unknown loop level information for statement " + to_string(*i)); } @@ -243,7 +243,7 @@ void Loop::permute(int stmt_num, int level, const std::vector<int> &pi) { break; } default: - throw loop_error( + throw chill::error::loop( "unknown loop level information for statement " + to_string(*i)); } @@ -351,7 +351,7 @@ void Loop::permute(const std::set<int> &active, const std::vector<int> &pi) { if (min_dep_dim > max_dep_dim) return; if (max_dep_dim - min_dep_dim + 1 != t.size()) - throw loop_error("cannot update the dependence graph after permuation"); + throw chill::error::loop("cannot update the dependence graph after permuation"); std::vector<int> dep_pi(num_dep_dim); for (int i = 0; i < min_dep_dim; i++) dep_pi[i] = i; @@ -393,7 +393,7 @@ void Loop::permute(const std::set<int> &active, const std::vector<int> &pi) { break; } default: - throw loop_error("unknown dependence type"); + throw chill::error::loop("unknown dependence type"); } } g.connect(i, j->first, dv); @@ -419,7 +419,7 @@ void Loop::permute(const std::set<int> &active, const std::vector<int> &pi) { case DEP_CONTROL: break; default: - throw loop_error("unknown dependence type"); + throw chill::error::loop("unknown dependence type"); } g.connect(i, j->first, dv); } @@ -452,7 +452,7 @@ void Loop::permute(const std::set<int> &active, const std::vector<int> &pi) { break; } default: - throw loop_error( + throw chill::error::loop( "unknown loop level information for statement " + to_string(*i)); } @@ -478,7 +478,7 @@ void Loop::permute(const std::set<int> &active, const std::vector<int> &pi) { break; } default: - throw loop_error( + throw chill::error::loop( "unknown loop level information for statement " + to_string(*i)); } @@ -605,7 +605,7 @@ std::set<int> Loop::split(int stmt_num, int level, const Relation &cond) { if (dv.type != DEP_CONTROL) if (dv.hasNegative(dimension) && !dv.quasi) - throw loop_error( + throw chill::error::loop( "loop error: Split is illegal, dependence violation!"); } @@ -662,7 +662,7 @@ std::set<int> Loop::split(int stmt_num, int level, const Relation &cond) { if (dv.hasNegative(dimension) && !dv.quasi) - throw loop_error( + throw chill::error::loop( "loop error: Split is illegal, dependence violation!"); } @@ -723,7 +723,7 @@ std::set<int> Loop::split(int stmt_num, int level, const Relation &cond) { if (dv.hasNegative(dimension) && !dv.quasi) - throw loop_error( + throw chill::error::loop( "loop error: Split is illegal, dependence violation!"); } @@ -777,7 +777,7 @@ std::set<int> Loop::split(int stmt_num, int level, const Relation &cond) { if (dv.hasNegative(dimension) && !dv.quasi) - throw loop_error( + throw chill::error::loop( "loop error: Split is illegal, dependence violation!"); } @@ -1030,7 +1030,7 @@ void Loop::skew(const std::set<int> &stmt_nums, int level, if ((dv.isCarried(dep_dim) && dv.hasNegative(dep_dim)) && !dv.quasi) - throw loop_error( + throw chill::error::loop( "loop error: Skewing is illegal, dependence violation!"); dv.lbounds[dep_dim] = lb; dv.ubounds[dep_dim] = ub; @@ -1040,7 +1040,7 @@ void Loop::skew(const std::set<int> &stmt_nums, int level, if ((dv.isCarried(dep_dim) && dv.hasNegative(dep_dim)) && !dv.quasi) - throw loop_error( + throw chill::error::loop( "loop error: Skewing is illegal, dependence violation!"); } } @@ -1256,7 +1256,7 @@ void Loop::fuse(const std::set<int> &stmt_nums, int level) { for (int k = 0; k < dvs.size(); k++) if (dvs[k].isCarried(dep_dim) && dvs[k].hasNegative(dep_dim)) - throw loop_error( + throw chill::error::loop( "loop error: statements " + to_string(*ii) + " and " + to_string(*jj) + " cannot be fused together due to negative dependence"); @@ -1264,7 +1264,7 @@ void Loop::fuse(const std::set<int> &stmt_nums, int level) { for (int k = 0; k < dvs.size(); k++) if (dvs[k].isCarried(dep_dim) && dvs[k].hasNegative(dep_dim)) - throw loop_error( + throw chill::error::loop( "loop error: statements " + to_string(*jj) + " and " + to_string(*ii) + " cannot be fused together due to negative dependence"); @@ -1300,9 +1300,9 @@ void Loop::fuse(const std::set<int> &stmt_nums, int level) { dep_dim); std::cout << g; s = typed_fusion(g, s2); - } catch (const loop_error &e) { + } catch (const chill::error::loop&e) { - throw loop_error( + throw chill::error::loop( "statements cannot be fused together due to negative dependence"); } @@ -1359,9 +1359,9 @@ void Loop::fuse(const std::set<int> &stmt_nums, int level) { dep_dim); std::cout<< g; s = typed_fusion(g); - } catch (const loop_error &e) { + } catch (const chill::error::loop&e) { - throw loop_error( + throw chill::error::loop( "statements cannot be fused together due to negative dependence"); } @@ -1417,7 +1417,7 @@ void Loop::fuse(const std::set<int> &stmt_nums, int level) { } } else - throw loop_error("Typed Fusion Error"); + throw chill::error::loop("Typed Fusion Error"); */ } @@ -1518,7 +1518,7 @@ void Loop::distribute(const std::set<int> &stmt_nums, int level) { std::vector<std::set<int> > s2 = g2.topoSort(); // nothing to distribute if (s2.size() == 1) - throw loop_error( + throw chill::error::loop( "loop error: no statement can be distributed due to dependence cycle"); std::vector<std::set<int> > s3; for (int i = 0; i < s2.size(); i++) { @@ -1603,7 +1603,7 @@ std::vector<std::vector<std::string> > constructInspectorVariables(IR_Code *ir, CG_outputRepr *subscript = (*i)->index(0); if ((*i)->n_dim() > 1) - throw ir_error( + throw chill::error::ir( "multi-dimensional array support non-existent for flattening currently"); while (ir->QueryExpOperation(subscript) == IR_OP_ARRAY_VARIABLE) { @@ -1627,7 +1627,7 @@ std::vector<std::vector<std::string> > constructInspectorVariables(IR_Code *ir, break; if (j == index.size()) - throw ir_error("Non index variable in array expression"); + throw chill::error::ir("Non index variable in array expression"); int k; for (k = 0; k < to_return.size(); k++) @@ -1758,7 +1758,7 @@ void Loop::normalize(int stmt_num, int loop_level) { Relation bound = get_loop_bound(r, loop_level, this->known); if (!bound.has_single_conjunct() || !bound.is_satisfiable() || bound.is_tautology()) - throw loop_error("unable to extract loop bound for normalize"); + throw chill::error::loop("unable to extract loop bound for normalize"); // extract the loop stride coef_t stride; @@ -1772,7 +1772,7 @@ void Loop::normalize(int stmt_num, int loop_level) { abs(result.first.get_coef(bound.set_var(loop_level)))); if (stride != 1) - throw loop_error( + throw chill::error::loop( "normalize currently only handles unit stride, non unit stride present in loop bounds"); GEQ_Handle lb; @@ -1831,7 +1831,7 @@ void Loop::normalize(int stmt_num, int loop_level) { } } else - throw loop_error("loop bounds too complex for normalize!"); + throw chill::error::loop("loop bounds too complex for normalize!"); } diff --git a/src/transformations/loop_datacopy.cc b/src/transformations/loop_datacopy.cc index 69fbd5b..c14e838 100644 --- a/src/transformations/loop_datacopy.cc +++ b/src/transformations/loop_datacopy.cc @@ -329,7 +329,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A fastest_changing_dimension = 0; break; default: - throw loop_error("unsupported array layout"); + throw chill::error::loop("unsupported array layout"); } // OK, parameter sanity checked @@ -579,7 +579,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A break; } default: - throw loop_error("unsupported array index expression"); + throw chill::error::loop("unsupported array index expression"); } } if ((*ei).get_const() != 0) @@ -620,7 +620,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A ub_list.push_back(*gi); } if (lb_list.size() == 0 || ub_list.size() == 0) - throw loop_error("failed to calcuate array footprint size"); + throw chill::error::loop("failed to calcuate array footprint size"); //fprintf(stderr, "dp3: build lower bound representation\n"); // build lower bound representation @@ -687,7 +687,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A break; } default: - throw loop_error("cannot calculate temporay array size statically"); + throw chill::error::loop("cannot calculate temporay array size statically"); } } h.update_const(ub_list[j].get_const()); @@ -710,7 +710,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A break; } default: - throw loop_error("cannot calculate temporay array size statically"); + throw chill::error::loop("cannot calculate temporay array size statically"); } } h.update_const(lb_list[k].get_const()); @@ -774,7 +774,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A break; } default: - throw loop_error("failed to generate array index bound code"); + throw chill::error::loop("failed to generate array index bound code"); } } } @@ -818,7 +818,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A std::swap(index_sz[0], index_sz[i]); break; default: - throw loop_error("unsupported array layout"); + throw chill::error::loop("unsupported array layout"); } } @@ -1007,7 +1007,7 @@ bool Loop::datacopy_privatized(const std::vector<std::pair<int, std::vector<IR_A break; } default: - throw loop_error("unsupported array layout"); + throw chill::error::loop("unsupported array layout"); } cur_index++; } diff --git a/src/transformations/loop_extra.cc b/src/transformations/loop_extra.cc index ee54815..216f586 100644 --- a/src/transformations/loop_extra.cc +++ b/src/transformations/loop_extra.cc @@ -120,7 +120,7 @@ void Loop::peel(int stmt_num, int level, int peel_amount) { } } if (!found_bound) - throw loop_error("can't find lower bound for peeling at loop level " + to_string(level)); + throw chill::error::loop("can't find lower bound for peeling at loop level " + to_string(level)); for (int i = 1; i <= peel_amount; i++) { Relation r(level); @@ -183,7 +183,7 @@ void Loop::peel(int stmt_num, int level, int peel_amount) { } } if (!found_bound) - throw loop_error("can't find upper bound for peeling at loop level " + to_string(level)); + throw chill::error::loop("can't find upper bound for peeling at loop level " + to_string(level)); for (int i = 1; i <= -peel_amount; i++) { Relation r(level); diff --git a/src/transformations/loop_tile.cc b/src/transformations/loop_tile.cc index 0a1808b..7281462 100644 --- a/src/transformations/loop_tile.cc +++ b/src/transformations/loop_tile.cc @@ -70,7 +70,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, stmt[*i].loop_level[l - 1].payload) && dv.hasPositive( stmt[*i].loop_level[l - 1].payload)) - throw loop_error( + throw chill::error::loop( "loop error: Tiling is illegal, dependence violation!"); } else { @@ -87,7 +87,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, if (dim3 < level - 1) if (dv.isCarried(dim3) && dv.hasPositive(dim3)) - throw loop_error( + throw chill::error::loop( "loop error: Tiling is illegal, dependence violation!"); } } @@ -167,7 +167,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, } if (!bound.has_single_conjunct()) - throw loop_error("cannot handle tile bounds"); + throw chill::error::loop("cannot handle tile bounds"); } // separate lower and upper bounds @@ -183,10 +183,10 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, } } if (lb_list.size() == 0) - throw loop_error( + throw chill::error::loop( "unable to calculate tile controlling loop lower bound"); if (ub_list.size() == 0) - throw loop_error( + throw chill::error::loop( "unable to calculate tile controlling loop upper bound"); // find the simplest lower bound for StridedTile or simplest iteration count for CountedTile @@ -352,7 +352,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, break; } default: - throw loop_error("cannot handle tile bounds"); + throw chill::error::loop("cannot handle tile bounds"); } } h.update_const(lb_list[simplest_lb].get_const()); @@ -387,7 +387,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, break; } default: - throw loop_error("cannot handle tile bounds"); + throw chill::error::loop("cannot handle tile bounds"); } } h1.update_const(lb_list[simplest_lb].get_const()); @@ -455,7 +455,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, break; } default: - throw loop_error("cannot handle tile bounds"); + throw chill::error::loop("cannot handle tile bounds"); } } h.update_const(ub_list[simplest_ub].get_const()); @@ -490,7 +490,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, break; } default: - throw loop_error("cannot handle tile bounds"); + throw chill::error::loop("cannot handle tile bounds"); } } h1.update_const(-ub_list[simplest_ub].get_const()); @@ -569,7 +569,7 @@ void Loop::tile(int stmt_num, int level, int tile_size, int outer_level, stmt[*i].loop_level[j - 1].payload++; break; default: - throw loop_error( + throw chill::error::loop( "unknown loop level type for statement " + to_string(*i)); } diff --git a/src/transformations/loop_unroll.cc b/src/transformations/loop_unroll.cc index 3238d50..fb82228 100644 --- a/src/transformations/loop_unroll.cc +++ b/src/transformations/loop_unroll.cc @@ -73,19 +73,19 @@ std::set<int> Loop::unroll(int stmt_num, int level, int unroll_amount, /*if (dv.isCarried(dim2) && (dv.hasNegative(dim2) && !dv.quasi)) - throw loop_error( + throw chill::error::loop( "loop error: Unrolling is illegal, dependence violation!"); if (dv.isCarried(dim2) && (dv.hasPositive(dim2) && dv.quasi)) - throw loop_error( + throw chill::error::loop( "loop error: Unrolling is illegal, dependence violation!"); */ bool safe = false; if (dv.isCarried(dim2) && dv.hasPositive(dim2)) { if (dv.quasi) - throw loop_error( + throw chill::error::loop( "loop error: a quasi dependence with a positive carried distance"); if (!dv.quasi) { if (dv.lbounds[dim2] != posInfinity) { @@ -127,7 +127,7 @@ std::set<int> Loop::unroll(int stmt_num, int level, int unroll_amount, if (dv.hasPositive(dim3)) break; else if (dv.hasNegative(dim3)) - throw loop_error( + throw chill::error::loop( "loop error: Unrolling is illegal, dependence violation!"); } } @@ -168,7 +168,7 @@ std::set<int> Loop::unroll(int stmt_num, int level, int unroll_amount, Relation bound = get_loop_bound(hull, level, this->known); if (!bound.has_single_conjunct() || !bound.is_satisfiable() || bound.is_tautology()) - throw loop_error("unable to extract loop bound for unrolling"); + throw chill::error::loop("unable to extract loop bound for unrolling"); // extract the loop stride coef_t stride; @@ -231,7 +231,7 @@ std::set<int> Loop::unroll(int stmt_num, int level, int unroll_amount, break; } default: - throw loop_error("failed to calculate overflow amount"); + throw chill::error::loop("failed to calculate overflow amount"); } } overflow_table[i][j][NULL] += ub_list[j].get_const(); @@ -261,7 +261,7 @@ std::set<int> Loop::unroll(int stmt_num, int level, int unroll_amount, break; } default: - throw loop_error("failed to calculate overflow amount"); + throw chill::error::loop("failed to calculate overflow amount"); } } overflow_table[i][j][NULL] += lb_list[i].get_const(); @@ -374,7 +374,7 @@ std::set<int> Loop::unroll(int stmt_num, int level, int unroll_amount, if (is_split_illegal) { rhs->clear(); delete rhs; - throw loop_error( + throw chill::error::loop( "cannot split cleanup code at loop level " + to_string(cleanup_split_level) + " due to overflow variable data dependence"); @@ -1112,7 +1112,7 @@ std::set<int> Loop::unroll(int stmt_num, int level, int unroll_amount, dvs11.push_back(dv); dvs22.push_back(dv); } else - throw loop_error( + throw chill::error::loop( "unrolled statements lumped together illegally"); } else { coef_t lb = dv.lbounds[dep_dim]; |