[llvm-dev] What is the status regarding min/max intrinsics?

Björn Pettersson A via llvm-dev llvm-dev at lists.llvm.org
Tue May 4 09:45:27 PDT 2021


Thanks! That’s the information I was looking for.
(I should probably have searched Bugzilla before asking, but did not consider that there would be a tracking ticket for this.)

/Björn

From: Sanjay Patel <spatel at rotateright.com>
Sent: den 4 maj 2021 17:40
To: Björn Pettersson A <bjorn.a.pettersson at ericsson.com>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] What is the status regarding min/max intrinsics?

We're getting closer to canonicalizing to the intrinsics...
But there are still some missing optimizations (mostly in instcombine I think) that we are hoping to address to reduce the chance of regressions:

This is the most current view of what's left:
https://reviews.llvm.org/D98152<https://protect2.fireeye.com/v1/url?k=76eaed62-2971d421-76eaadf9-861fcb972bfc-86120ef2147243d4&q=1&e=9a685f40-a59c-44c4-b6e7-242740966e6b&u=https%3A%2F%2Freviews.llvm.org%2FD98152>

We've also been tracking the work with:
https://llvm.org/PR46915<https://protect2.fireeye.com/v1/url?k=3009013b-6f923878-300941a0-861fcb972bfc-3d5c7dc1e9443079&q=1&e=9a685f40-a59c-44c4-b6e7-242740966e6b&u=https%3A%2F%2Fllvm.org%2FPR46915>

On Tue, May 4, 2021 at 4:59 AM Björn Pettersson A via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:
The llvm.smin, llvm.smax, llvm.umin and llvm.umax intrinsics were
introduced quite some time ago.

As far as I known we still don't canonicalize IR to use those
intrinsics (but I suppose that is the end goal), nor do we
canonicalize by doing a reverse transform into a select.

Are there any known limitations in support for the min/max intrinsics
that prevents us from using them or trying to canonicalize IR into
using the intrinsics?
(and if so, shouldn't we canonicalize into a select-pattern if that
form still is "better")

Main reason for asking is that I'd like to know if it is safe
to simplify clang/opt to use the min/max intrinsics directly
instead of emitting a select-kind-of-pattern. Or is it a huge risk
that I end up with regressions due to optimizers not understanding
the min/max intrinsics yet?

Regards,
Björn


_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<https://protect2.fireeye.com/v1/url?k=39b675ac-662d4cef-39b63537-861fcb972bfc-4149570410d2a0ce&q=1&e=9a685f40-a59c-44c4-b6e7-242740966e6b&u=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210504/f26c4815/attachment.html>


More information about the llvm-dev mailing list