Merge branches 'fix-phisrc' and 'insert-last-insn' into memops-prep

* fix and improve the check that protects try_to_simplify_bb()
* fix remove_merging_phisrc() with duplicated CFG edges.