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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 03:24:02 PDT 2020


lebedev.ri added a comment.

In D87160#2257569 <https://reviews.llvm.org/D87160#2257569>, @nikic wrote:

> 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?

Separate patch is fine i think.

> 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).

Maybe, but i don't anticipate such need.

> 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