@@ -26,8 +26,6 @@ PHI_DECLARE_bool(prim_skip_dynamic);
2626using paddle::dialect::DenseTensorType;
2727using paddle::dialect::SelectedRowsType;
2828
29- constexpr char kPrimBelongTo [] = " prim_belong_to" ;
30-
3129namespace paddle {
3230
3331using Program = pir::Program;
@@ -294,8 +292,6 @@ void DecompProgram::decomp_program() {
294292 for (auto & op : *block) {
295293 ops_list.push_back (&op);
296294 }
297- size_t decomp_end_index = 0 ;
298- size_t sub_op_start_index = 0 ;
299295 for (size_t i = 0 ; i < ops_list.size (); i++) {
300296 auto op = ops_list[i];
301297 bool enable_prim =
@@ -318,33 +314,6 @@ void DecompProgram::decomp_program() {
318314 op->name (), orig_outs, standard_decomp_res, orig_vars_dict);
319315
320316 op->ReplaceAllUsesWith (standard_decomp_res);
321-
322- std::vector<pir::Operation*> tmp_ops_list;
323- for (auto & tmp_op : *block) {
324- tmp_ops_list.push_back (&tmp_op);
325- }
326- bool attach_belong_op_info = false ;
327-
328- for (size_t j = sub_op_start_index; j < tmp_ops_list.size (); j++) {
329- auto sub_op = tmp_ops_list[j];
330- auto it = std::find (ops_list.begin (), ops_list.end (), sub_op);
331- if (((it != ops_list.end ()) && sub_op == ops_list[i - 1 ]) ||
332- ((it == ops_list.end ()) && j == decomp_end_index)) {
333- attach_belong_op_info = true ;
334- continue ;
335- }
336-
337- if (sub_op == ops_list[i]) {
338- decomp_end_index = j - 1 ;
339- attach_belong_op_info = false ;
340- sub_op_start_index = decomp_end_index;
341- }
342- if (attach_belong_op_info) {
343- pir::Attribute attribute (builder.str_attr (op->name ()));
344- sub_op->set_attribute (kPrimBelongTo , attribute);
345- }
346- }
347-
348317 bool remove_op = true ;
349318 for (auto & item : op->results ()) {
350319 if (item.HasOneUse ()) {
0 commit comments