[SDAG][Backend] Extend the default `TLI.isTruncFree(SDValue, EVT)`
Open
llvm:SelectionDAG
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
There are a few similar cases here that would surely be free across targets: for example, `isTruncFree(sext/zext x)` should return true (`x` already exists and thus is free), similarly for constants.
This should be simple enough for a beginner to add. Just search for `TargetLoweringInfo::isTruncFree`.
This would allow deduplication of code like [this](https://github.com/llvm/llvm-project/pull/176366) better across different opcodes.
Contributor guide
Assessment
This issue has not been assessed yet.