[PATCH] Optimize square root squared (PR21126)

Sanjay Patel spatel at rotateright.com
Thu Oct 2 11:17:27 PDT 2014


Hi hfinkel, majnemer, dexonsmith,

When unsafe-fp-math is enabled, we can turn sqrt(X) * sqrt(X) into X. 

This can happen in the real world when calculating x ** 3/2. This occurs in test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c.

http://reviews.llvm.org/D5584

Files:
  lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  test/Transforms/InstCombine/fmul.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5584.14338.patch
Type: text/x-patch
Size: 1742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141002/66759cb2/attachment.bin>


More information about the llvm-commits mailing list