Fix CMOV conversion.
commit3fc639f72a9cddf83ee6e457265d4fe87f026d1b
authorStas Boukarev <stassats@gmail.com>
Sat, 6 Jan 2018 21:22:02 +0000 (7 00:22 +0300)
committerStas Boukarev <stassats@gmail.com>
Sat, 6 Jan 2018 21:22:02 +0000 (7 00:22 +0300)
tree17866e4dadc8b22973df05f880c1d49a05502139
parent4d3c74ef34628d5a66dac647da2f2e908e25cf00
Fix CMOV conversion.

BRANCH-IF and CIF may end be in different IR1 blocks (due to
cleanups), but since the BRANCH-IF is emitted from a conditional VOP
it ends up in the same IR2 block as the VOP.
MAYBE-CONVERT-ONE-CMOV tries to use (block-succ (ir2-block-block
2block)) to see where the branches lead, but the CIF is in the
following IR1 block.
Use the CIF as the node when converting BRANCH-IF, which can be used
by MAYBE-CONVERT-ONE-CMOV to find the actual block.
There's a bit of an inconsistency that a single IR2 block straddles
two IR1 blocks, but it's harmless.

Fixes lp#1741679
src/compiler/ir2opt.lisp
src/compiler/ir2tran.lisp
src/compiler/ltn.lisp
tests/compiler-2.pure.lisp