leo-ard wrote: > If I understood correctly, what you're trying to do here is to apply an icmp > fold early before the sext -> zext information gets lost. I don't think this > is the correct way to approach the problem. The correct way is to preserve > the fact that the operand is non-negative when converting to zext, which > would allow the InstCombine fold to reliably undo this. In fact, there is a > pending patch for this at https://reviews.llvm.org/D156444.
When tackling this problem, my first idea was to track the non-negativeness of the zext and use this information in InstCombine. I didn't know that you could do it through flags in the IR, which I think is a cleaner solution. Do you think this patch will be available soon ? https://github.com/llvm/llvm-project/pull/67594 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits