diff options
author | Dan Gohman <gohman@apple.com> | 2009-01-13 23:25:30 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-01-13 23:25:30 +0000 |
commit | 286575c65c096e4d226b8a4c4a29a88d1c846b4f (patch) | |
tree | f360b20ab5622dc43c9d524e42176fb3f5437cad | |
parent | f31408d75c42f48041e40aaaee147dcaa8477bc0 (diff) | |
download | external_llvm-286575c65c096e4d226b8a4c4a29a88d1c846b4f.zip external_llvm-286575c65c096e4d226b8a4c4a29a88d1c846b4f.tar.gz external_llvm-286575c65c096e4d226b8a4c4a29a88d1c846b4f.tar.bz2 |
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
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index fe665c3..a8bcfea 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -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)); |