[PATCH] D144493: [InstSimplify] enhance simplifyWithOpReplaced() to allow more 'select' removal

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 08:59:20 PST 2023


spatel added a comment.

In D144493#4141817 <https://reviews.llvm.org/D144493#4141817>, @nikic wrote:

> I like the approach, but I'm not sure you're checking the right poison implications. My first thought would be that we need `impliesPoison(V, Op)`. We are replacing the select with V, so what we want to establish is that if V is poison, the select would be poison anyway because Op is also implied poison.

Yes, that is clearer and seems to work. I'm not finding a test diff given the other constraints in place...
Also, I initially misread the recursive depth check in `impliesPoison()` - we can look past the binop itself and each of its operands.


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

https://reviews.llvm.org/D144493



More information about the llvm-commits mailing list