Merging r258729:
authorHans Wennborg <hans@hanshq.net>
Tue, 26 Jan 2016 19:31:16 +0000 (19:31 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 26 Jan 2016 19:31:16 +0000 (19:31 +0000)
commit4b85564ba4a41465155b9128a68e5e14fea78365
tree86052df3fe1bb2c9730e2c45524956d0489163be
parentdb6cb1a90cd0ab35e2dadc97962a5d67742c0bbc
Merging r258729:
------------------------------------------------------------------------
r258729 | matze | 2016-01-25 14:08:25 -0800 (Mon, 25 Jan 2016) | 13 lines

X86ISelLowering: Fix cmov(cmov) special lowering bug

There's a special case in EmitLoweredSelect() that produces an improved
lowering for cmov(cmov) patterns. However this special lowering is
currently broken if the inner cmov has multiple users so this patch
stops using it in this case.

If you wonder why this wasn't fixed by continuing to use the special
lowering and inserting a 2nd PHI for the inner cmov: I believe this
would incur additional copies/register pressure so the special lowering
does not improve upon the normal one anymore in this case.

This fixes http://llvm.org/PR26256 (= rdar://24329747)
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@258840 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/cmovcmov.ll