[PATCH] D141188: [MergeICmps] Adapt to non-eq comparisons

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 17:44:26 PDT 2023

aeubanks added a comment.

In D141188#4327218 <https://reviews.llvm.org/D141188#4327218>, @aeubanks wrote:

> In D141188#4320968 <https://reviews.llvm.org/D141188#4320968>, @aeubanks wrote:
>> In D141188#4320794 <https://reviews.llvm.org/D141188#4320794>, @Allen wrote:
>>> hi @aeubanks, as the discussion on https://reviews.llvm.org/D149542, the miscompile (https://alive2.llvm.org/ce/z/Zr5dfP) doesn't need to be handled ?
>> hmm I swear the miscompile I was seeing wasn't related to poison/freeze, it was similar to the previous miscompile where it was just a wrong true/false. I'll take a look again
> I didn't see an issue reapplying this patch on the test case I was looking at so I've relanded it, sorry for the trouble

Oh that alive2 link is a miscompile even disregarding poison semantics. `src` is implementing a `!=`, but it ends up being a `==` with the `memcmp` after this pass runs (I got confused with the `memcmp` return value being 0 on equal instead of 1). Basically it should be
`%3 = icmp eq i32 %memcmp, 0` instead of `%3 = icmp ne i32 %memcmp, 0`.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list