[Diffusion] rG5419b671375c: [SimplifyCFG] Update FoldTwoEntryPHINode to handle and/or of select and binop…

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 13:23:48 PDT 2021


lebedev.ri added a comment.

In rG5419b671375c46299ff1da6c929859040e7beaf5#1014711 <https://reviews.llvm.org/rG5419b671375c46299ff1da6c929859040e7beaf5#1014711>, @nikic wrote:

> In rG5419b671375c46299ff1da6c929859040e7beaf5#1014705 <https://reviews.llvm.org/rG5419b671375c46299ff1da6c929859040e7beaf5#1014705>, @lebedev.ri wrote:
>
>> In rG5419b671375c46299ff1da6c929859040e7beaf5#1014700 <https://reviews.llvm.org/rG5419b671375c46299ff1da6c929859040e7beaf5#1014700>, @nikic wrote:
>>
>>> @lebedev.ri We canonicalize to the correct form in InstCombine. At which point does SimplifyCFG produce the non-canonical form?
>>
>> At any point where it produces a boolean select where one of it's operands happens to be a constant,
>> one that doesn't happen to match the expected constant for that operand.
>
> I guess the question would be more precisely: Where does it produce such a select where it previously would have produced a bitwise and/or?

Sorry, i don't know of any such places.
My comment is more general - now that `cc ? true : c2` and `cc ? c2 : false` are estabilished as logical or/and,
i don't think we can just pretend that we have no idea what `cc ? c2 : true` and `cc ? false : c2` are,
until InstCombine canonicalizes them. rG7ef6f019090f3979fa345105b9ac95ac589c6cf9 <https://reviews.llvm.org/rG7ef6f019090f3979fa345105b9ac95ac589c6cf9> is only a symptom, but it is worrying.


BRANCHES
  llvm_jit_comment, main, ml-spread-test

Users:
  aqjune (Author)

https://reviews.llvm.org/rG5419b671375c



More information about the llvm-commits mailing list