aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-11-16 21:29:08 +0000
committerHal Finkel <hfinkel@anl.gov>2013-11-16 21:29:08 +0000
commit12100bf7e8db74696ef05aef268ca5708ae48f03 (patch)
treeca7d0ef6ec233f4c11eb2edeb116c1ec1f874787 /clang/lib/Frontend/CompilerInvocation.cpp
parentdfb3e7092ebcb919c26f63e98a1bd14647671dea (diff)
downloadllvm-12100bf7e8db74696ef05aef268ca5708ae48f03.zip
llvm-12100bf7e8db74696ef05aef268ca5708ae48f03.tar.gz
llvm-12100bf7e8db74696ef05aef268ca5708ae48f03.tar.bz2
Apply the InstCombine fptrunc sqrt optimization to llvm.sqrt
InstCombine, in visitFPTrunc, applies the following optimization to sqrt calls: (fptrunc (sqrt (fpext x))) -> (sqrtf x) but does not apply the same optimization to llvm.sqrt. This is a problem because, to enable vectorization, Clang generates llvm.sqrt instead of sqrt in fast-math mode, and because this optimization is being applied to sqrt and not applied to llvm.sqrt, sometimes the fast-math code is slower. This change makes InstCombine apply this optimization to llvm.sqrt as well. This fixes the specific problem in PR17758, although the same underlying issue (optimizations applied to libcalls are not applied to intrinsics) exists for other optimizations in SimplifyLibCalls. llvm-svn: 194935
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions