]> granicus.if.org Git - llvm/commit
[InstCombine] peek through fdiv to find a squared sqrt
authorSanjay Patel <spatel@rotateright.com>
Mon, 8 Apr 2019 21:23:50 +0000 (21:23 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 8 Apr 2019 21:23:50 +0000 (21:23 +0000)
commit44ffd2ca9e8180ff9cf229c216989b5714cb82b9
tree4cf8ab3744aa0a744dd7ea35f32beabdbb375ec8
parenta2b71f96a9d64aaccd23687d424d54bceb093160
[InstCombine] peek through fdiv to find a squared sqrt

A more general canonicalization between fdiv and fmul would not
handle this case because that would have to be limited by uses
to prevent 2 values from becoming 3 values:
(x/y) * (x/y) --> (x*x) / (y*y)

(But we probably should still have that limited -- but more general --
canonicalization independently of this change.)

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