diff options
author | kper <kevin.per@protonmail.com> | 2025-09-12 09:43:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-12 09:43:47 +0200 |
commit | 59102db770183835f549c58ad6954f39a407fe5e (patch) | |
tree | 89a5c531fc4cf73aedfe23708655e792715a5da5 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | d7b7b9cd6d12a8cbc35fba4ecfd0a557011e9cdd (diff) | |
download | llvm-59102db770183835f549c58ad6954f39a407fe5e.zip llvm-59102db770183835f549c58ad6954f39a407fe5e.tar.gz llvm-59102db770183835f549c58ad6954f39a407fe5e.tar.bz2 |
[InstCombine] Added optimisation for trunc (Negated Pow2 >> x) to i1 (#157998)
Follow up of https://github.com/llvm/llvm-project/pull/157030
```
trunc ( lshr i8 C1, V1) to i1 -> icmp ugt V1, cttz(C1) - 1 iff (C1) is negative power of 2
trunc ( ashr i8 C1, V1) to i1 -> icmp ugt V1, cttz(C1) - 1 iff (C1) is negative power of 2
```
General proof:
lshr: https://alive2.llvm.org/ce/z/vVfaJc
ashr: https://alive2.llvm.org/ce/z/8aAcgD
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions