OSDN Git Service

[X86] When looking for (CMOV C-1, (ADD (CTTZ X), C), (X != 0)) -> (ADD (CMOV (CTTZ...
authorCraig Topper <craig.topper@intel.com>
Wed, 1 Aug 2018 06:36:20 +0000 (06:36 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 1 Aug 2018 06:36:20 +0000 (06:36 +0000)
commita79cc075efb62fc3adbb0a7cc0a260311182b598
tree854069b5ccdc4a387182a926e24cd7511e097bea
parent6f455447cbb06f4d0fbe62966c90fcc592372658
[X86] When looking for (CMOV C-1, (ADD (CTTZ X), C), (X != 0)) -> (ADD (CMOV (CTTZ X), -1, (X != 0)), C), make sure we really have a compare with 0.

It's not strictly required by the transform of the cmov and the add, but it makes sure we restrict it to the cases we know we want to match.

While there canonicalize the operand order of the cmov to simplify the matching and emitting code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338492 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp