[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)
commit14593eb417e2cd345e1785bd311d55d1f1dd556b
tree28d0266b52541483832f536a8bc5e3f974ac47e9
parent8b5527deefdfcb7a2ea90b9b4d2116864e7d493f
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231046 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/cmovcmov.ll