Skip to content

Commit

Permalink
[APInt] Replace calls to setBits with more specific calls to setBitsF…
Browse files Browse the repository at this point in the history
…rom and setLowBits where possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301768 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Apr 30, 2017
1 parent 78c3b9e commit c07d5e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2516,7 +2516,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, KnownBits &Known,
computeKnownBits(Op.getOperand(1), Known2, DemandedElts, Depth + 1);
KnownZeroLow = std::min(KnownZeroLow,
Known2.Zero.countTrailingOnes());
Known.Zero.setBits(0, KnownZeroLow);
Known.Zero.setLowBits(KnownZeroLow);
break;
}
case ISD::UADDO:
Expand Down
6 changes: 3 additions & 3 deletions lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26701,11 +26701,11 @@ void X86TargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
break;
LLVM_FALLTHROUGH;
case X86ISD::SETCC:
Known.Zero.setBits(1, BitWidth);
Known.Zero.setBitsFrom(1);
break;
case X86ISD::MOVMSK: {
unsigned NumLoBits = Op.getOperand(0).getValueType().getVectorNumElements();
Known.Zero.setBits(NumLoBits, BitWidth);
Known.Zero.setBitsFrom(NumLoBits);
break;
}
case X86ISD::VSHLI:
Expand Down Expand Up @@ -26746,7 +26746,7 @@ void X86TargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
DAG.computeKnownBits(N0, Known, DemandedSrcElts, Depth + 1);
Known.One = Known.One.zext(BitWidth);
Known.Zero = Known.Zero.zext(BitWidth);
Known.Zero.setBits(InBitWidth, BitWidth);
Known.Zero.setBitsFrom(InBitWidth);
break;
}
}
Expand Down

0 comments on commit c07d5e6

Please sign in to comment.