ARM: Revert SVN r253865, 254158, fix windows division
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 17 Mar 2016 14:10:49 +0000 (14:10 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 17 Mar 2016 14:10:49 +0000 (14:10 +0000)
commit071a099102a4183309dbc80d52fc2454a9222f1e
tree64b6f939482f2deffaa51fa426dd77b526c3274f
parent97439926e4ae88db7f603814e4abafefcfcc26d5
ARM: Revert SVN r253865, 254158, fix windows division

The two changes together weakened the test and caused a regression with division
handling in MSVC mode.  They were applied to avoid an assertion being triggered
in the block frequency analysis.  However, the underlying problem was simply
being masked rather than solved properly.  Address the actual underlying problem
and revert the changes.  Rather than analyze the cause of the assertion, the
division failure was assumed to be an overflow.

The underlying issue was a subtle bug in the BB construction in the emission of
the div-by-zero check (WIN__DBZCHK).  We did not construct the proper successor
information in the basic blocks, nor did we update the PHIs associated with the
basic block when we split them.  This would result in assertions being triggered
in the block frequency analysis pass.

Although the original tests are being removed, the tests themselves performed
very little in terms of validation but merely tested that we did not assert when
generating code.  Update this with new tests that actually ensure that we do not
regress on the code generation.

llvm-svn: 263714
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/Windows/dbzchk.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/Windows/division.ll
llvm/test/CodeGen/ARM/Windows/overflow.ll [deleted file]