[PATCH] D146905: [IR] Add llvm.tan.* intrinsic

Jun Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 01:39:01 PDT 2023


junaire marked 2 inline comments as done.
junaire added a comment.

In D146905#4225435 <https://reviews.llvm.org/D146905#4225435>, @craig.topper wrote:

> Is there a corresponding patch for the clang part?

Not yet. But I'll create one later.

> LibCallSimplifier::optimizeFloatingPointLibCall should be called during InstCombine via the use of LibCallSimplifier in InstCombinerImpl::tryOptimizeCall.
> Adding an intrinsic for tan will require adding intrinsic versions of the existing tan optimizations in optimizeFloatingPointLibCall to avoid regressions there.

Ughh, does it should be handled in `InstCombinerImpl::visitCallInst`? Looks like if it's an intrinsic, it will not take the code path? (https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp#L1311-L1312)

> Need to add it to llvm/include/llvm/Analysis/VecFuncs.def so the vectorizer knows it can vectorize it to vector math library. Weirdly some parts of that file think llvm.tan and some other intrinsics already exists.
> I suppose llvm.tan should also be added to llvm::isTriviallyVectorizable in VectorUtils.cpp.

Done.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146905



More information about the llvm-commits mailing list