This change is to implement following rules:
authorShuxin Yang <shuxin.llvm@gmail.com>
Mon, 7 Jan 2013 21:39:23 +0000 (21:39 +0000)
committerShuxin Yang <shuxin.llvm@gmail.com>
Mon, 7 Jan 2013 21:39:23 +0000 (21:39 +0000)
commitd3ae2866d105f6da6375544eb41aea0dad75a9f2
tree657172554ba94af328ded24558b69793423d40fc
parent2f1bfc4c7937fdf59e2d88e0e23d0657daba79b2
This change is to implement following rules:

  o. X/C1 * C2 => X * (C2/C1) (if C2/C1 is neither special FP nor denormal)
  o. X/C1 * C2 -> X/(C1/C2)   (if C2/C1 is either specical FP or denormal, but C1/C2 is a normal Fp)

     Let MDC denote multiplication or dividion with one & only one operand being a constant
  o. (MDC ± C1) * C2 => (MDC * C2) ± (C1 * C2)
     (so long as the constant-folding doesn't yield any denormal or special value)

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