[llvm] [LV] Fix for miscompile with disjoint or (PR #81922)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 03:15:45 PST 2024


https://github.com/fhahn commented:

> any comments here? Is this the correct direction for the fix? The miscompile is a functional bug here.

Sorry this dropped off my radar. I think in terms of correctness, this would be OK, but quite aggressive. IIUC we would only need to bail out *if* the `OR` was used by SCEV (and treated as `ADD`). But unfortunately there's no easy way to check if it was used in such a way.

As @nikic suggested, it should be fine to convert it to an `ADD` instead, which has less negative impact. I tried to see if that would be feasible and sketched it in #83821

https://github.com/llvm/llvm-project/pull/81922


More information about the llvm-commits mailing list