Commit 6c649c7b authored by Paul's avatar Paul
Browse files

Fix compile errors

parent 99ee76c0
......@@ -115,13 +115,13 @@ void memory_coloring_impl::build()
if(is_allocate(iter) || is_lit)
{
live_range& range = def_interval->segment;
def_interval->result = iter->result;
def_interval->result = iter->get_shape();
def_interval->is_literal = is_lit;
if(!is_lit || unify_literals)
alloc_queue.push(def_interval);
range.begin = cur_points;
def_interval->def_point = cur_points;
range.size = (iter->result).bytes();
range.size = (iter->get_shape()).bytes();
live_set.erase(range.vn);
}
}
......@@ -131,7 +131,7 @@ void memory_coloring_impl::build()
}
int tie_ndx = get_input_tie_ndx(iter);
int cnt = -1;
for(auto&& arg : iter->arguments)
for(auto&& arg : iter->inputs())
{
cnt++;
if(is_param(arg) || is_outline(arg))
......@@ -228,9 +228,9 @@ void memory_coloring_impl::rewrite()
if(is_allocate(ins))
{
if(!ins->arguments.empty())
if(!ins->inputs().empty())
p_program->replace_instruction(
ins, load{ins->arguments.at(0)->result, offset}, scratch_param);
ins, load{ins->inputs().at(0)->get_shape(), offset}, scratch_param);
}
else if(is_literal(ins))
{
......
......@@ -79,23 +79,23 @@ struct memory_coloring_impl
void rewrite();
private:
static bool is_param(const instruction_ref ins) { return ins->op.name() == "@param"; }
static bool is_param(const instruction_ref ins) { return ins->name() == "@param"; }
static bool is_output_param(const instruction_ref ins)
{
return is_param(ins) && any_cast<builtin::param>(ins->op).parameter == "output";
return is_param(ins) && any_cast<builtin::param>(ins->get_operator()).parameter == "output";
}
bool is_allocate(const instruction_ref ins) { return ins->op.name() == allocation_op; }
static bool is_outline(const instruction_ref ins) { return ins->op.name() == "@outline"; }
static bool is_literal(const instruction_ref ins) { return ins->op.name() == "@literal"; }
bool is_allocate(const instruction_ref ins) { return ins->name() == allocation_op; }
static bool is_outline(const instruction_ref ins) { return ins->name() == "@outline"; }
static bool is_literal(const instruction_ref ins) { return ins->name() == "@literal"; }
static bool is_check_context(const instruction_ref ins)
{
return ins->op.name() == "check_context";
return ins->name() == "check_context";
}
// get operand alias info. This is a temporary workaround.
int get_input_tie_ndx(const instruction_ref ins)
{
std::string name = ins->op.name();
std::string name = ins->name();
if(operand_alias.find(name) != operand_alias.end())
return operand_alias[name];
if(is_allocate(ins))
......@@ -106,7 +106,7 @@ struct memory_coloring_impl
}
int cnt = -1;
int last_allocate = -1;
for(auto&& arg : ins->arguments)
for(auto&& arg : ins->inputs())
{
cnt++;
if(is_allocate(arg) || is_output_param(arg))
......
......@@ -207,9 +207,9 @@ instruction_ref program::get_parameter(std::string name) const
{
auto ins = std::find_if(
impl->instructions.begin(), impl->instructions.end(), [&](const instruction& x) {
if(x.op.name() == "@param")
if(x.name() == "@param")
{
return any_cast<builtin::param>(x.op).parameter == name;
return any_cast<builtin::param>(x.get_operator()).parameter == name;
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment