Files
clang-p2996/llvm/test/Transforms
mskamp 949bbdc923 [InstCombine] Fold Minimum over Trailing/Leading Bits Counts (#90402)
The new transformation folds `umin(cttz(x), c)` to `cttz(x | (1 << c))`
and `umin(ctlz(x), c)` to `ctlz(x | ((1 << (bitwidth - 1)) >> c))`. The
transformation is only implemented for constant `c` to not increase the
number of instructions.
    
The idea of the transformation is to set the c-th lowest (for `cttz`) or
highest (for `ctlz`) bit in the operand. In this way, the `cttz` or
`ctlz` instruction always returns at most `c`.
    
Alive2 proofs: https://alive2.llvm.org/ce/z/y8Hdb8

Fixes #90000
2024-07-13 16:55:11 +02:00
..
2024-06-19 10:22:52 +02:00