[PATCH] D41283: [InstCombine] Missed optimization in math expression: tan(a) * cos(a) == sin(a)

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 10:44:04 PST 2018


hfinkel added a comment.

In https://reviews.llvm.org/D41283#974832, @spatel wrote:

> In https://reviews.llvm.org/D41283#974808, @Quolyk wrote:
>
> > In https://reviews.llvm.org/D41283#974798, @spatel wrote:
> >
> > > Why doesn't tan have an LLVM intrinsic like sin/cos?
> >
> >
> > I don't know
>
>
> Then we should find out. :) 
>  I should've asked before https://reviews.llvm.org/D41286, but oops. 
>  cc @efriedma in case he knows the history. If not, you should ask on llvm-dev. Maybe it's just not as common to see tan in code, but if we're going to do more trig transforms, I think it would make sense to have uniformity of trig intrinsics, so it's easier to do these folds. Also, if the vectorizers recognize trig functions, it would make it easier for them if we have more intrinsics for these functions?


I agree. In the past, AFAIK, we've added the intrinsics on an as-needed basis.


https://reviews.llvm.org/D41283





More information about the llvm-commits mailing list