llvm / llvm/llvm-project

[SDAG][Backend] Extend the default `TLI.isTruncFree(SDValue, EVT)`

Open
#176,453 1 comment 0 reactions 1 assignee Claimed by @DaKnig View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.