Added a slew of SimplifyInstruction floating-point optimizations, many of which take...
authorMichael Ilseman <milseman@apple.com>
Wed, 12 Dec 2012 00:27:46 +0000 (00:27 +0000)
committerMichael Ilseman <milseman@apple.com>
Wed, 12 Dec 2012 00:27:46 +0000 (00:27 +0000)
commit09ee250e728ccdb7afc6354d777f8319c5a0465c
tree41e7a8c97d5b62f99aff6058bac1248ee5defb66
parent1d4b1507045075273cb301efec8722b961b78c22
Added a slew of SimplifyInstruction floating-point optimizations, many of which take advantage of fast-math flags. Test cases included.

  fsub X, +0 ==> X
  fsub X, -0 ==> X, when we know X is not -0
  fsub +/-0.0, (fsub -0.0, X) ==> X
  fsub nsz +/-0.0, (fsub +/-0.0, X) ==> X
  fsub nnan ninf X, X ==> 0.0
  fadd nsz X, 0 ==> X
  fadd [nnan ninf] X, (fsub [nnan ninf] 0, X) ==> 0
    where nnan and ninf have to occur at least once somewhere in this expression
  fmul X, 1.0 ==> X

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169940 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/InstructionSimplify.h
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/fast-math.ll
test/Transforms/InstSimplify/floating-point-arithmetic.ll [new file with mode: 0644]