From e540800d5a9321a60db564f134180fecdc44e55a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 15 Oct 2005 22:35:40 +0000 Subject: [PATCH] Fix this logic. llvm-svn: 23756 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 35c981d7f3db..5b1d10335cf4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -808,7 +808,7 @@ SDOperand DAGCombiner::visitAND(SDNode *N) { if (ConstantSDNode *N01C = dyn_cast(N0.getOperand(1))) { // If the RHS of the AND has zeros where the sign bits of the SRA will // land, turn the SRA into an SRL. - if (MaskedValueIsZero(N1, (~0ULL << N01C->getValue()) & + if (MaskedValueIsZero(N1, (~0ULL << (OpSizeInBits-N01C->getValue())) & (~0ULL>>(64-OpSizeInBits)), TLI)) { WorkList.push_back(N); CombineTo(N0.Val, DAG.getNode(ISD::SRL, VT, N0.getOperand(0),