[llvm] 98efa8f - [DAG] Fix ShrinkDemandedOp doxygen description to match behaviour. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 18 14:44:24 PST 2023
Author: Simon Pilgrim
Date: 2023-11-18T22:44:08Z
New Revision: 98efa8f9aad3e81224d826113620f1cef7708c4a
URL: https://github.com/llvm/llvm-project/commit/98efa8f9aad3e81224d826113620f1cef7708c4a
DIFF: https://github.com/llvm/llvm-project/commit/98efa8f9aad3e81224d826113620f1cef7708c4a.diff
LOG: [DAG] Fix ShrinkDemandedOp doxygen description to match behaviour. NFC.
ShrinkDemandedOp checks for both isTruncateFree AND isZExtFree but extends with ANY_EXTEND.
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 862d8a2b3dc48bb..9d5934eeefc686f 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -3824,9 +3824,10 @@ class TargetLowering : public TargetLoweringBase {
return false;
}
- /// 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.
+ /// Convert x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free.
+ /// This uses isTruncateFree/isZExtFree and ANY_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 &DemandedBits,
TargetLoweringOpt &TLO) const;
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 07cebba0937e70c..127c2410985b403 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -566,8 +566,9 @@ bool TargetLowering::ShrinkDemandedConstant(SDValue Op,
}
/// 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.
+/// This uses isTruncateFree/isZExtFree and ANY_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 &DemandedBits,
TargetLoweringOpt &TLO) const {
More information about the llvm-commits
mailing list