[X86] Special-case 2x CMOV when custom-inserting.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 3 Mar 2015 01:21:16 +0000 (01:21 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 3 Mar 2015 01:21:16 +0000 (01:21 +0000)
commitafbd6887c4a70a6bbaa1d7c423a5f78e07d8bce4
tree575d8944cc6c0a0caab38819c6fdfe026cf5579b
parent066d0b8e646ef91c787dc4deea98433cceab7793
[X86] Special-case 2x CMOV when custom-inserting.

This lets us avoid a few copies that are otherwise hard to get rid of.
The way this is done is, the custom-inserter looks at the following
instruction for another CMOV, and replaces both at the same time.
A previous version used a new CMOV2 opcode, but the custom inserter
is expected to be able to return a different basic block anyway, which
means it's OK - though far from ideal - to alter that block's contents.
Explicitly document that, in case it ever makes a difference.
Alternatives welcome!

Follow-up to r231045.

rdar://19767934
Closes http://reviews.llvm.org/D8019

llvm-svn: 231046
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/cmovcmov.ll