[PATCH] D79321: [SLC] Allow llvm.pow(2**n,x) -> llvm.exp2(n*x) even if no exp2 lib func

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 13:31:08 PDT 2020


efriedma added a comment.

The "intrinsic" part of an intrinsic just means that the call has special semantics.  Some intrinsics can't be implemented by certain targets, or don't make sense. And some intrinsics which make sense on a target in theory might not actually be implemented.  This is actually true for instructions as well, although the cases where this comes up are more rare.

Fundamentally, the issue is that when compiling C, LLVM has limited control over the link and runtime environment.  If an environment requires linking against a libc that doesn't have exp2, we don't have any control over that, and can't really do anything about it, unless we want to teach the compiler to emit an implementation inline.

We currently don't have any uniform way of dealing with this at the moment; if you're interested in adding one, it would make sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79321





More information about the llvm-commits mailing list