Skip to content

Commit

Permalink
[DAG] TargetLowering::ShrinkDemandedOp - rename Demanded arg to Deman…
Browse files Browse the repository at this point in the history
…dedBits. NFC

Make it clear this is referring to DemandedBits not DemandedElts.
  • Loading branch information
RKSimon committed Mar 15, 2023
1 parent 55f7e00 commit dc20ce7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion llvm/include/llvm/CodeGen/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -3717,7 +3717,8 @@ class TargetLowering : public TargetLoweringBase {
/// Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free. This
/// uses isZExtFree and ZERO_EXTEND for the widening cast, but it could be
/// generalized for targets with other types of implicit widening casts.
bool ShrinkDemandedOp(SDValue Op, unsigned BitWidth, const APInt &Demanded,
bool ShrinkDemandedOp(SDValue Op, unsigned BitWidth,
const APInt &DemandedBits,
TargetLoweringOpt &TLO) const;

/// Look at Op. At this point, we know that only the DemandedBits bits of the
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ bool TargetLowering::ShrinkDemandedConstant(SDValue Op,
/// This uses isZExtFree and ZERO_EXTEND for the widening cast, but it could be
/// generalized for targets with other types of implicit widening casts.
bool TargetLowering::ShrinkDemandedOp(SDValue Op, unsigned BitWidth,
const APInt &Demanded,
const APInt &DemandedBits,
TargetLoweringOpt &TLO) const {
assert(Op.getNumOperands() == 2 &&
"ShrinkDemandedOp only supports binary operators!");
Expand All @@ -574,7 +574,7 @@ bool TargetLowering::ShrinkDemandedOp(SDValue Op, unsigned BitWidth,
// Search for the smallest integer type with free casts to and from
// Op's type. For expedience, just check power-of-2 integer types.
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
unsigned DemandedSize = Demanded.getActiveBits();
unsigned DemandedSize = DemandedBits.getActiveBits();
unsigned SmallVTBits = DemandedSize;
SmallVTBits = llvm::bit_ceil(SmallVTBits);
for (; SmallVTBits < BitWidth; SmallVTBits = NextPowerOf2(SmallVTBits)) {
Expand Down

0 comments on commit dc20ce7

Please sign in to comment.