use -0.0 when creating an fneg instruction
authorSanjay Patel <spatel@rotateright.com>
Fri, 19 Dec 2014 16:44:08 +0000 (16:44 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 19 Dec 2014 16:44:08 +0000 (16:44 +0000)
commitea3c8028871749a289d9d40a13962c0cf90d3c35
tree4054430c163a821c8006a9b74c1de2d8b9c5c7f6
parent55ef1515021a9dea737bea38468950999945884a
use -0.0 when creating an fneg instruction

Backends recognize (-0.0 - X) as the canonical form for fneg
and produce better code. Eg, ppc64 with 0.0:

   lis r2, ha16(LCPI0_0)
   lfs f0, lo16(LCPI0_0)(r2)
   fsubs f1, f0, f1
   blr

vs. -0.0:

   fneg f1, f1
   blr

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

llvm-svn: 224583
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/test/Transforms/InstCombine/fast-math.ll