aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ModuloSchedule.cpp
diff options
context:
space:
mode:
authorPiotr Fusik <p.fusik@samsung.com>2025-04-10 09:08:08 +0200
committerGitHub <noreply@github.com>2025-04-10 09:08:08 +0200
commit807cc3791fabd47bd24d57a8e4ab7df9117b3ede (patch)
tree56d67ac2b8d48246a3681275cfb42d6bb6b3a370 /llvm/lib/CodeGen/ModuloSchedule.cpp
parent3fd0d22d74027c00bd2365ea1691dc530bb9709a (diff)
downloadllvm-807cc3791fabd47bd24d57a8e4ab7df9117b3ede.zip
llvm-807cc3791fabd47bd24d57a8e4ab7df9117b3ede.tar.gz
llvm-807cc3791fabd47bd24d57a8e4ab7df9117b3ede.tar.bz2
[DAGCombiner] Fold subtraction if above threshold to `umin` (#134235)
Folds patterns such as: unsigned foo(unsigned x, unsigned y) { return x >= y ? x - y : x; } Before, on RISC-V: sltu a2, a0, a1 addi a2, a2, -1 and a1, a1, a2 subw a0, a0, a1 Or, with Zicond: sltu a2, a0, a1 czero.nez a1, a1, a2 subw a0, a0, a1 After, with Zbb: subw a1, a0, a1 minu a0, a0, a1 Only applies to unsigned comparisons. If `x >= y` then `x - y` is less than or equal `x`. Otherwise, `x - y` wraps and is greater than `x`.
Diffstat (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp')
0 files changed, 0 insertions, 0 deletions