[PATCH] D148986: [InstSimplify] with logical ops: (X | Y) ? 0 : X --> 0

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 06:10:26 PDT 2023


Allen added a comment.

In D148986#4292191 <https://reviews.llvm.org/D148986#4292191>, @nikic wrote:

> In D148986#4290283 <https://reviews.llvm.org/D148986#4290283>, @nikic wrote:
>
>> @Allen My bad -- we need an additional change in order to remove that code. For now you can just leave it.
>
> Actually, I think I confused myself here. We should be able to remove this code now. From a local test, this works. (Well, if you also handle the and / -1 case.)

Yes, the **or/ 0** part can be deleted now. And the  and / -1 case should be deleted with a following MR



================
Comment at: llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll:144
 
+; TODO: https://alive2.llvm.org/ce/z/X6QjcB
 define i64 @select_clz_to_ctz_i64_wrong_xor(i64 %a) {
----------------
nikic wrote:
> Unrelated change?
Yes, I add the TODO as it is a potential optimization points


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

https://reviews.llvm.org/D148986



More information about the llvm-commits mailing list