diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-11-05 22:07:18 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-11-18 22:44:08 +0000 |
commit | 98efa8f9aad3e81224d826113620f1cef7708c4a (patch) | |
tree | 0ca8acd4c43ee3f96284d1a7e83dcc46bcd51db4 | |
parent | 7fd021a0929094bc4b6407896b735b7d360df36c (diff) |
[DAG] Fix ShrinkDemandedOp doxygen description to match behaviour. NFC.
ShrinkDemandedOp checks for both isTruncateFree AND isZExtFree but extends with ANY_EXTEND.
-rw-r--r-- | llvm/include/llvm/CodeGen/TargetLowering.h | 7 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h index 862d8a2b3dc4..9d5934eeefc6 100644 --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -3824,9 +3824,10 @@ public: 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 07cebba0937e..127c2410985b 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 { |