[SimplifyLibCalls] add reflection fold for -sin(-x) (PR38458)
authorSanjay Patel <spatel@rotateright.com>
Mon, 13 Aug 2018 19:24:41 +0000 (19:24 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 13 Aug 2018 19:24:41 +0000 (19:24 +0000)
commite45a83d4479434d7bd6d7a3adc9e88bc159f2eb1
treea732af733941d2dc432a00b835d0d66e7e70565a
parentf138fda5edc21004de744ed354e9142b8c2ee109
[SimplifyLibCalls] add reflection fold for -sin(-x) (PR38458)

This is a very partial fix for the reported problem. I suspect
we do not get this fold in most motivating cases because most of
the time, the libcall would have been replaced by an intrinsic,
and that optimization is handled elsewhere...but maybe it should
be handled here?

llvm-svn: 339604
llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/cos-1.ll