[PATCH] D87160: [SCEV] Recognize min/max intrinsics

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 03:16:07 PDT 2020


nikic added a comment.

In D87160#2257554 <https://reviews.llvm.org/D87160#2257554>, @lebedev.ri wrote:

> Two afterthoughts:
>
> 1. I suspect that until SCEV actually produces these intrinsics, this is `undef`-unsafe. Thought i suspect there are other similar problems, so i'm not sure if we should worry about it just yet.

Yes, that's right. This will get resolved once we start canonicalizing to intrinsics, and until then a lot of the min/max handling is undef-unsafe anyway.

> 2. Should also handle `abs`:

Would you like to have that included in this patch or separately? I don't believe that SCEV currently recognizes abs in select form, so this one might need additional SCEVExpander support at the same time (to at least expand it into a reasonable select). There's also some other intrinsics that could be handled, e.g. `usub.sat(a, b)` is `umax(a, b) - b`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87160



More information about the llvm-commits mailing list