File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -163,9 +163,18 @@ static inline void normalize_ir_post_phi_elimination(MachineFunction &MF) {
163163
164164 // Handle the last potential rewrite entry. Lower instead of journaling a
165165 // rewrite entry if all predecessor MBBs are in this single entry.
166- if (to_insert.pred_MBBs .size () == MBB.pred_size ())
167- // Lower
168- move_body (to_insert.body ,MBB);
166+ if (to_insert.pred_MBBs .size () == MBB.pred_size ()) {
167+ move_body (to_insert.body , MBB);
168+ for (MachineBasicBlock *pred_MBB : to_insert.pred_MBBs ) {
169+ // Delete instructions that were lowered from epilog
170+ MachineInstr &branch_ins =
171+ get_branch_with_dest (*pred_MBB, *to_insert.succ_MBB );
172+ auto epilog_it = ++Epilog_Iterator (branch_ins.getIterator ());
173+ while (!epilog_it.isEnd ())
174+ epilog_it++->eraseFromBundle ();
175+ }
176+
177+ }
169178 else if (to_insert.body .size ())
170179 cfg_rewrite_entries.push_back (to_insert);
171180 }
You can’t perform that action at this time.
0 commit comments