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 127132 include/llvm/Analysis/TargetLibraryInfo.def
include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Analysis/TargetLibraryInfo.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/cabs-array.ll
test/Transforms/InstCombine/cabs-discrete.ll
unittests/Analysis/TargetLibraryInfoTest.cpp
|