This is an archive of the discontinued LLVM Phabricator instance.

use -0.0 when creating an fneg instruction
ClosedPublic

Authored by spatel on Dec 18 2014, 10:31 AM.

Details

Summary

Simple (I hope) bug fix when generating an fneg operation in InstCombine. 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

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 17451.Dec 18 2014, 10:31 AM
spatel retitled this revision from to use -0.0 when creating an fneg instruction.
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added reviewers: hfinkel, resistor.
spatel added a subscriber: Unknown Object (MLST).
This revision was automatically updated to reflect the committed changes.