[all-commits] [llvm/llvm-project] fcd7b8: [X86] Add baseline test for X86 conditional load/s...

azwolski via All-commits all-commits at lists.llvm.org
Wed Oct 15 04:12:21 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fcd7b8daa1633ae2549365438aab03eca92b1a44
      https://github.com/llvm/llvm-project/commit/fcd7b8daa1633ae2549365438aab03eca92b1a44
  Author: azwolski <antoni.zwolski at intel.com>
  Date:   2025-10-15 (Wed, 15 Oct 2025)

  Changed paths:
    M llvm/test/CodeGen/X86/apx/cf.ll

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list