[llvm-commits] [llvm] r62195 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Dan Gohman
gohman at apple.com
Tue Jan 13 15:25:30 PST 2009
Author: djg
Date: Tue Jan 13 17:25:30 2009
New Revision: 62195
URL: http://llvm.org/viewvc/llvm-project?rev=62195&view=rev
Log:
Don't use a BT instruction if the AND has multiple uses.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62195&r1=62194&r2=62195&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 13 17:25:30 2009
@@ -5034,7 +5034,9 @@
// 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));
More information about the llvm-commits
mailing list