[PATCH] D115914: [InstCombine] Fold two PHI operands of `or` conditionally.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 12 06:18:12 PST 2022


spatel added a comment.

In D115914#3232967 <https://reviews.llvm.org/D115914#3232967>, @luna wrote:

> thanks everyone for the feedback!
>
> carrot@ had a fix for another issue (in https://reviews.llvm.org/D116058) that has overlap with this one, but covering more cases like https://godbolt.org/z/or7W1b7eE and https://godbolt.org/z/MqTh5Te9c
>
> I'm going to hold this for a while; hopefully after https://reviews.llvm.org/D116058 is in, this patch is not needed.

I don't think D116058 <https://reviews.llvm.org/D116058> is viable (and I'll comment there too). 
This patch seems ok, but it's both too restrictive (only works with 'or') and potentially more costly than necessary (at least as a first step, we can check for constants instead of trying to simplify generally and fix the motivating tests). I put up an alternate patch: D117110 <https://reviews.llvm.org/D117110> .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115914/new/

https://reviews.llvm.org/D115914



More information about the llvm-commits mailing list