Optimize square root squared (PR21126).
authorSanjay Patel <spatel@rotateright.com>
Thu, 2 Oct 2014 21:10:54 +0000 (21:10 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 2 Oct 2014 21:10:54 +0000 (21:10 +0000)
commit0ff4eb684f236216d6b654d333a28f867e0bbaca
tree1aed78debd32fb47b2874e0a06ea09ca12e04826
parent130d072eb70ffff97309d16ff2816b243b3e1a45
Optimize square root squared (PR21126).

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.

Differential Revision: http://reviews.llvm.org/D5584

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218906 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
test/Transforms/InstCombine/fmul.ll