]> granicus.if.org Git - llvm/commit
[InstCombine] canonicalize fdiv after fmul if reassociation is allowed
authorSanjay Patel <spatel@rotateright.com>
Mon, 15 Apr 2019 13:23:38 +0000 (13:23 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 15 Apr 2019 13:23:38 +0000 (13:23 +0000)
commit2ab4f529bb65cd8501ebdd700683d176773cba7c
tree928e0ee3760fe828f24939b9362b58846b135af1
parent90597d4a3c4aa4eaa70dfa8ea65cc8a386584aad
[InstCombine] canonicalize fdiv after fmul if reassociation is allowed

  (X / Y) * Z --> (X * Z) / Y

This can allow other optimizations/reassociations as shown in the test diffs.

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