When unsafe algerbra is allowed calls to cabs(r) can be replaced by:
sqrt(creal(r)*creal(r) + cimag(r)*cimag(r))
Paths
| Differential D40069
[SimplifyLibCall] Inline calls to cabs when it's safe to do so. ClosedPublic Authored by paulwalker-arm on Nov 15 2017, 2:46 AM.
Details Summary When unsafe algerbra is allowed calls to cabs(r) can be replaced by: sqrt(creal(r)*creal(r) + cimag(r)*cimag(r))
Diff Detail
Event TimelineComment Actions LGTM. At least on PowerPC, the signature is simply two arguments: declare double @cabs(double, double) declare float @cabsf(float, float) declare ppc_fp128 @cabsl(ppc_fp128, ppc_fp128) If you could add support for that signature as well, that would be much appreciated. This revision is now accepted and ready to land.Dec 14 2017, 4:54 PM Closed by commit rL320901: [SimplifyLibCalls] Inline calls to cabs when it's safe to do so (authored by hfinkel). · Explain WhyDec 15 2017, 5:27 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 127219 llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.def
llvm/trunk/include/llvm/Transforms/Utils/SimplifyLibCalls.h
llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/trunk/test/Transforms/InstCombine/cabs-array.ll
llvm/trunk/test/Transforms/InstCombine/cabs-discrete.ll
llvm/trunk/unittests/Analysis/TargetLibraryInfoTest.cpp
|