[PATCH] Handle sqrt() shrinking in SimplifyLibCalls like any other call

Sanjay Patel spatel at rotateright.com
Wed Oct 22 14:06:15 PDT 2014


Hi hfinkel, beanz,

This patch removes a chunk of special case logic for folding sqrt() -> sqrtf() in InstCombineCasts and handles it in the mainstream path of SimplifyLibCalls. 

No functional change intended, but I loosened the restriction on the existing sqrt testcases to allow for this optimization even without unsafe-fp-math because that's the existing behavior.

I also added a missing test case for not shrinking the llvm.sqrt.f64 intrinsic in case the result is used as a double.

http://reviews.llvm.org/D5919

Files:
  lib/Transforms/InstCombine/InstCombineCasts.cpp
  lib/Transforms/Utils/SimplifyLibCalls.cpp
  test/Transforms/InstCombine/double-float-shrink-1.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5919.15278.patch
Type: text/x-patch
Size: 5922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141022/711fe26c/attachment.bin>


More information about the llvm-commits mailing list