diff options
| author | Valeriy Savchenko <vsavchenko@apple.com> | 2025-11-07 09:03:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-07 09:03:55 +0000 |
| commit | 3e90ecaa2fe252e6c9c045ad8ad1ce7dfefd526d (patch) | |
| tree | 015d91a22ba821a064b1a0f3f979d66a940d4b01 /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces | |
| parent | a04ceb02ad316cc4f2e6edfdeacc089526751608 (diff) | |
| download | llvm-3e90ecaa2fe252e6c9c045ad8ad1ce7dfefd526d.zip llvm-3e90ecaa2fe252e6c9c045ad8ad1ce7dfefd526d.tar.gz llvm-3e90ecaa2fe252e6c9c045ad8ad1ce7dfefd526d.tar.bz2 | |
[ValueTracking] Refine known bits for linear interpolation patterns (#166378)
In this patch, we try to detect the lerp pattern: a * (b - c) + c * d
where a >= 0, b >= 0, c >= 0, d >= 0, and b >= c.
In that particular case, we can use the following chain of reasoning:
a * (b - c) + c * d <= a' * (b - c) + a' * c = a' * b where a' = max(a,
d)
Since that is true for arbitrary a, b, c and d within our constraints,
we can
conclude that:
max(a * (b - c) + c * d) <= max(max(a), max(d)) * max(b) = U
Considering that any result of the lerp would be less or equal to U, it
would
have at least the number of leading 0s as in U.
While being quite a specific situation, it is fairly common in computer
graphics in the shape of alpha blending.
In conjunction with #165877, increases vectorization factor for lerp
loops.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces')
0 files changed, 0 insertions, 0 deletions
