diff options
author | mskamp <msk@posteo.org> | 2024-07-16 16:50:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-16 15:50:21 +0100 |
commit | b22fa9093bb1a7be2de4e9d7073c94d3ecb69987 (patch) | |
tree | fb71a5307ae28b5d84ee27df14328103989fd15c /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 78dea4c1ea77ba683c720d2a2c0f32d03989f8cc (diff) | |
download | llvm-b22fa9093bb1a7be2de4e9d7073c94d3ecb69987.zip llvm-b22fa9093bb1a7be2de4e9d7073c94d3ecb69987.tar.gz llvm-b22fa9093bb1a7be2de4e9d7073c94d3ecb69987.tar.bz2 |
[ValueTracking][X86] Compute KnownBits for phadd/phsub (#92429)
Add KnownBits computations to ValueTracking and X86 DAG lowering.
These instructions add/subtract adjacent vector elements in their operands. Example: phadd [X1, X2] [Y1, Y2] = [X1 + X2, Y1 + Y2]. This means that, in this example, we can compute the KnownBits of the operation by computing the KnownBits of [X1, X2] + [X1, X2] and [Y1, Y2] + [Y1, Y2] and intersecting the results. This approach also generalizes to all x86 vector types.
There are also the operations phadd.sw and phsub.sw, which perform saturating addition/subtraction. Use sadd_sat and ssub_sat to compute the KnownBits of these operations.
Also adjust the existing test case pr53247.ll because it can be transformed to a constant using the new KnownBits computation.
Fixes #82516.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions