[CODEGEN] removed buggy (and mostly useless) optimization in peephole pass (#449)
This commit is contained in:
@@ -227,22 +227,22 @@ bool peephole::rewrite_cvt_layout(ir::instruction *value, ir::builder& builder){
|
|||||||
ir::instruction* op = dynamic_cast<ir::instruction*>(cvt->get_operand(0));
|
ir::instruction* op = dynamic_cast<ir::instruction*>(cvt->get_operand(0));
|
||||||
if(!op)
|
if(!op)
|
||||||
return false;
|
return false;
|
||||||
// convert(elementwise(x, y)) = elementwise(convert(x), convert(y))
|
// // convert(elementwise(x, y)) = elementwise(convert(x), convert(y))
|
||||||
if(op->get_id() == ir::INST_BINOP){
|
// if(op->get_id() == ir::INST_BINOP){
|
||||||
for(size_t i = 0; i < op->get_num_operands(); i++){
|
// for(size_t i = 0; i < op->get_num_operands(); i++){
|
||||||
ir::value* arg_i = op->get_operand(i);
|
// ir::value* arg_i = op->get_operand(i);
|
||||||
builder.set_insert_point(op);
|
// builder.set_insert_point(op);
|
||||||
// create new layout transform
|
// // create new layout transform
|
||||||
ir::instruction* new_arg_i = cvt->clone();
|
// ir::instruction* new_arg_i = cvt->clone();
|
||||||
layouts_->copy(new_arg_i, op);
|
// layouts_->copy(new_arg_i, op);
|
||||||
builder.insert(new_arg_i);
|
// builder.insert(new_arg_i);
|
||||||
// set the right args
|
// // set the right args
|
||||||
new_arg_i->replace_uses_of_with(new_arg_i->get_operand(0), arg_i);
|
// new_arg_i->replace_uses_of_with(new_arg_i->get_operand(0), arg_i);
|
||||||
op->replace_uses_of_with(arg_i, new_arg_i);
|
// op->replace_uses_of_with(arg_i, new_arg_i);
|
||||||
}
|
// }
|
||||||
cvt->replace_all_uses_with(op);
|
// cvt->replace_all_uses_with(op);
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
auto cvt_op = dynamic_cast<ir::cvt_layout_inst*>(op);
|
auto cvt_op = dynamic_cast<ir::cvt_layout_inst*>(op);
|
||||||
if(!cvt_op)
|
if(!cvt_op)
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user