llvm-6502/lib/Transforms/InstCombine
Hal Finkel 64fa501b10 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194935 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 21:29:08 +00:00
..
CMakeLists.txt
InstCombine.h Add instcombine visitor for addrspacecast 2013-11-15 05:45:08 +00:00
InstCombineAddSub.cpp
InstCombineAndOrXor.cpp Update the docs to match the function name. 2013-11-13 01:12:01 +00:00
InstCombineCalls.cpp
InstCombineCasts.cpp Apply the InstCombine fptrunc sqrt optimization to llvm.sqrt 2013-11-16 21:29:08 +00:00
InstCombineCompares.cpp InstCombine: fold (A >> C) == (B >> C) --> (A^B) < (1 << C) for constant Cs. 2013-11-16 16:00:48 +00:00
InstCombineLoadStoreAlloca.cpp
InstCombineMulDivRem.cpp InstCombine: Replace manual fast math flag copying with the new IRBuilder RAII helper. 2013-09-30 15:39:59 +00:00
InstCombinePHI.cpp
InstCombineSelect.cpp
InstCombineShifts.cpp
InstCombineSimplifyDemanded.cpp Remove x86_sse42_crc32_64_8 intrinsic. It has no functional difference from x86_sse42_crc32_32_8 and was not mapped to a clang builtin. I'm not even sure why this form of the instruction is even called out explicitly in the docs. Also add AutoUpgrade support to convert it into the other intrinsic with appropriate trunc and zext. 2013-10-15 05:20:47 +00:00
InstCombineVectorOps.cpp Scalarize select vector arguments when extracted. 2013-11-04 20:36:06 +00:00
InstCombineWorklist.h
InstructionCombining.cpp Make gep i8* X, -(ptrtoint Y) transform work with address spaces 2013-10-03 18:15:57 +00:00
LLVMBuild.txt
Makefile