Akira Hatanaka 522cf235e9 Fix a bug in DemoteRegToStack where a reload instruction was inserted into the
wrong basic block.

This would happen when the result of an invoke was used by a phi instruction
in the invoke's normal destination block. An instruction to reload the invoke's
value would get inserted before the critical edge was split and a new basic
block (which is the correct insertion point for the reload) was created. This
commit fixes the bug by splitting the critical edge before all the reload
instructions are inserted.

Also, hoist up the code which computes the insertion point to the only place
that need that computation.

rdar://problem/15978721


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-09 06:38:23 +00:00
..
2014-09-02 22:45:13 +00:00
2014-08-26 12:47:26 +00:00
2014-11-14 22:45:23 +00:00
2015-01-14 22:27:36 +00:00
2014-11-17 14:08:57 +00:00
2014-12-04 19:34:50 +00:00
2014-09-02 22:46:18 +00:00
2014-11-03 17:38:00 +00:00
2014-08-20 10:40:20 +00:00
2015-01-19 15:16:06 +00:00
2014-09-23 23:18:01 +00:00
2014-12-22 13:29:46 +00:00
2014-12-09 21:25:00 +00:00
2014-12-09 21:25:00 +00:00