aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorhanbeom <kese111@gmail.com>2024-08-14 17:52:36 +0900
committerGitHub <noreply@github.com>2024-08-14 09:52:36 +0100
commit0d074ba197166b4f00cc3b1b1011625eb7be0a53 (patch)
tree504a79c48fe2ad197ccd5e745b746ef7ac2504b2 /llvm/lib/IR/Module.cpp
parent5ab99bf1a757c5ad7115280f374d9af4f1b98bc9 (diff)
downloadllvm-0d074ba197166b4f00cc3b1b1011625eb7be0a53.zip
llvm-0d074ba197166b4f00cc3b1b1011625eb7be0a53.tar.gz
llvm-0d074ba197166b4f00cc3b1b1011625eb7be0a53.tar.bz2
[DAG] Support saturated truncate (#99418)
A truncate is considered saturated if no additional conversion is required between the target and return values. If the target is saturated when attempting to truncate from a vector, there is an opportunity to optimize it. Previously, each architecture had its own attempt at optimization, leading to redundant code. This patch implements common logic by introducing three new ISDs: `ISD::TRUNCATE_SSAT_S`: When the operand is a signed value and the range of values matches the range of signed values of the destination type. `ISD::TRUNCATE_SSAT_U`: When the operand is a signed value and the range of values matches the range of unsigned values of the destination type. `ISD::TRUNCATE_USAT_U`: When the operand is an unsigned value and the range of values matches the range of unsigned values of the destination type. These ISDs indicate a saturated truncate. Fixes https://github.com/llvm/llvm-project/issues/85903
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions