[PATCH] D148420: [InstSimplify] Enhance select icmp and simplification

Peixin Qiao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 08:18:05 PDT 2023


peixin planned changes to this revision.
peixin added a comment.

In D148420#4298441 <https://reviews.llvm.org/D148420#4298441>, @nikic wrote:

> In D148420#4295784 <https://reviews.llvm.org/D148420#4295784>, @peixin wrote:
>
>> In D148420#4291703 <https://reviews.llvm.org/D148420#4291703>, @nikic wrote:
>>
>>> It looks like this should be part of simplifySelectBitTest(), which covers other "select of icmp and" patterns.
>>
>> It seems not, the `CondVal` in `simplifySelectWithICmpCond` is ICmp of value and zero. For cases in `simplifySelectBitTest`, the `CondVal` is ICmp of value and value.
>
> Not sure I follow. Isn't it matching the `(X & C) == 0` pattern here? https://github.com/llvm/llvm-project/blob/f6ec56ac5be26ad862e22d0eebb2645d1ad78218/llvm/lib/Analysis/InstructionSimplify.cpp#L4494-L4500

OK. I get your idea. You are right. Will fix this.


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

https://reviews.llvm.org/D148420



More information about the llvm-commits mailing list