[llvm] dc20ce7 - [DAG] TargetLowering::ShrinkDemandedOp - rename Demanded arg to DemandedBits. NFC
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 15 06:22:36 PDT 2023
Author: Simon Pilgrim
Date: 2023-03-15T13:22:21Z
New Revision: dc20ce7e543df452772ae8e2c4f97c390dd87b23
URL: https://github.com/llvm/llvm-project/commit/dc20ce7e543df452772ae8e2c4f97c390dd87b23
DIFF: https://github.com/llvm/llvm-project/commit/dc20ce7e543df452772ae8e2c4f97c390dd87b23.diff
LOG: [DAG] TargetLowering::ShrinkDemandedOp - rename Demanded arg to DemandedBits. NFC
Make it clear this is referring to DemandedBits not DemandedElts.
Added:
Modified:
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 76770cb2423f..1489a1d3b2a0 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -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
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 93f940a2fa5d..8cb1055e2661 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -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!");
@@ -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)) {
More information about the llvm-commits
mailing list