[llvm] [InstCombine] Fold `(X==Z || Y==Z) ? (X==Z && Y==Z) : X==Y --> X==Y` (PR #108619)

Marina Taylor via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 08:34:46 PDT 2024


citymarina wrote:

> It looks like InstCombine canonicalizes this to something like `(X == Z) ? (Y == Z) : !(Y == Z) && X == Y)`, see https://alive2.llvm.org/ce/z/XY_HMX. Shouldn't we be matching that pattern instead?

I am new in this area and unfamiliar with the conventions. My thought process was that matching something closer to the Swift-generated IR would better express the intent of this patch, and also I wasn't sure if I could rely on the altered form remaining stable over time. But if you think it would be better then I'm happy to update the patch.

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


More information about the llvm-commits mailing list