Begin teaching the X86 target how to efficiently codegen patterns that
authorChandler Carruth <chandlerc@gmail.com>
Tue, 20 Dec 2011 11:19:37 +0000 (11:19 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 20 Dec 2011 11:19:37 +0000 (11:19 +0000)
commitf2d7693fbb10f9ec3457e539dd5ba4bdb4cb3b85
tree51d8d182eca8534af9da8428e4642dc0270a8ea8
parent093147abf423428d338979a839273369810698cc
Begin teaching the X86 target how to efficiently codegen patterns that
use the zero-undefined variants of CTTZ and CTLZ. These are just simple
patterns for now, there is more to be done to make real world code using
these constructs be optimized and codegen'ed properly on X86.

The existing tests are spiffed up to check that we no longer generate
unnecessary cmov instructions, and that we generate the very important
'xor' to transform bsr which counts the index of the most significant
one bit to the number of leading (most significant) zero bits. Also they
now check that when the variant with defined zero result is used, the
cmov is still produced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146974 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrCompiler.td
test/CodeGen/X86/clz.ll