ARM: maintain BB ordering when expanding WIN__DBZCHK
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 25 Mar 2016 19:48:06 +0000 (19:48 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 25 Mar 2016 19:48:06 +0000 (19:48 +0000)
commit750a90df6ab4d119fe0fab51715464dad5ebaf2b
tree660ebd132b13a3e87efa4addd94fbf5b0ebf4d62
parent7daec890f2b3ed17849414736de701666e2c41de
ARM: maintain BB ordering when expanding WIN__DBZCHK

It is possible to have a fallthrough MBB prior to MBB placement.  The original
addition of the BB would result in reordering the BB as not preceding the
successor.  Because of the fallthrough nature of the BB, we could end up
executing incorrect code or even a constant pool island!  Insert the spliced BB
into the same location to avoid that.

Thanks to Tim Northover for invaluable hints and Fiora for the discussion on
what may have been occurring!

llvm-svn: 264454
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/Windows/dbzchk.ll
llvm/test/CodeGen/ARM/Windows/division.ll