[PATCH] D96663: [InstCombine] Fold icmp (select c, const, arg), null if arg has nonnullattr

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 22:49:24 PST 2021


aqjune added a comment.

In D96663#2584000 <https://reviews.llvm.org/D96663#2584000>, @xbolva00 wrote:

> In D96663#2583945 <https://reviews.llvm.org/D96663#2583945>, @aqjune wrote:
>
>> Make foldICmpInstWithConstantNotInt fold (select cond, null, arg) == null if arg has nonnullattr instead
>
> But original fold was more powerful and general IMHO.

I think it is hard to tell which version is more general - the previous patch was explicitly relying on uses that have nonnull attributes whereas the new one relies on assume calls.
This patch has more power if there are many assume calls.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96663



More information about the llvm-commits mailing list