[PATCH] fold: sqrt(x * x * y) -> fabs(x) * sqrt(y)

Sanjay Patel spatel at rotateright.com
Thu Oct 16 10:31:03 PDT 2014


Removed the change to InstCombineMulDivRem and the additional test case; function-level attributes do NOT override IR-level FMF.
But since we have no FMF support for intrinsics currently, added FIXMEs where we have to use the function-level attribute to make this optimization possible. The new testcases also have 'fast' at the IR level on all fmul. I think that should be a requirement for this optimization.

The intrinsic enhancement is filed as:
http://llvm.org/bugs/show_bug.cgi?id=21290

but as discussed here:
http://llvm.org/bugs/show_bug.cgi?id=21291

the IR-level FMF is not actually doing the job it was intended to do because the backend currently overrides/ignores all IR-level FMF.

http://reviews.llvm.org/D5787

Files:
  include/llvm/Transforms/Utils/SimplifyLibCalls.h
  lib/Transforms/Utils/SimplifyLibCalls.cpp
  test/Transforms/InstCombine/fast-math.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5787.15027.patch
Type: text/x-patch
Size: 11721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141016/d5b9f502/attachment.bin>


More information about the llvm-commits mailing list