diff options
author | azwolski <antoni.zwolski@intel.com> | 2025-10-15 13:11:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-15 11:11:59 +0000 |
commit | fcd7b8daa1633ae2549365438aab03eca92b1a44 (patch) | |
tree | b954fcff5820de1e62873b3db85a79f1fa95a2ec /llvm/lib/Bitcode/Reader/MetadataLoader.cpp | |
parent | 727525629ed4fec4b802ab0d53ea61696316b045 (diff) | |
download | llvm-fcd7b8daa1633ae2549365438aab03eca92b1a44.zip llvm-fcd7b8daa1633ae2549365438aab03eca92b1a44.tar.gz llvm-fcd7b8daa1633ae2549365438aab03eca92b1a44.tar.bz2 |
[X86] Add baseline test for X86 conditional load/store optimization bug (#163354)
This PR adds a baseline test that exposes a bug in the current
`combineX86CloadCstore` optimization. The generated assembly
demonstrates incorrect behavior when the optimization is applied without
proper constraints.
Without any assumptions about `X` this transformation is only valid when
`Y` is a non zero power of two/single-bit mask.
```cpp
// res, flags2 = sub 0, (and (xor X, -1), Y)
// cload/cstore ..., cond_ne, flag2
// ->
// res, flags2 = sub 0, (and X, Y)
// cload/cstore ..., cond_e, flag2
```
In the provided test case, the value in `%al` is unknown at compile
time. If `%al` contains `0`, the optimization cannot be applied, because
`(and (xor X, -1), 0)` is not equal to `(and X, 0)`.
Fix: https://github.com/llvm/llvm-project/pull/163353
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
0 files changed, 0 insertions, 0 deletions