Don't use a BT instruction if the AND has multiple uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-01-13 23:25:30 +00:00
parent f31408d75c
commit 286575c65c

View File

@ -5034,7 +5034,9 @@ SDValue X86TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) {
// Lower ((X >>u N) & 1) != 0 to BT.
// Lower ((X >>s N) & 1) != 0 to BT.
// FIXME: Is i386 or later or available only on some chips?
if (Op0.getOpcode() == ISD::AND && Op1.getOpcode() == ISD::Constant &&
if (Op0.getOpcode() == ISD::AND &&
Op0.hasOneUse() &&
Op1.getOpcode() == ISD::Constant &&
Op0.getOperand(1).getOpcode() == ISD::Constant &&
(CC == ISD::SETEQ || CC == ISD::SETNE)) {
ConstantSDNode *AndRHS = cast<ConstantSDNode>(Op0.getOperand(1));