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) | |
download | llvm-98efa8f9aad3e81224d826113620f1cef7708c4a.zip llvm-98efa8f9aad3e81224d826113620f1cef7708c4a.tar.gz llvm-98efa8f9aad3e81224d826113620f1cef7708c4a.tar.bz2 |
[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 862d8a2..9d5934e 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 07cebba..127c2410 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 { |