This is an archive of the discontinued LLVM Phabricator instance.

DAG: Do not scalarize fsub if fneg is legal
ClosedPublic

Authored by arsenm on Jan 21 2017, 11:25 AM.

Details

Reviewers
bogner
hfinkel
Summary

Tests will be included with future commit

Diff Detail

Event Timeline

arsenm created this revision.Jan 21 2017, 11:25 AM
hfinkel added inline comments.Feb 9 2017, 6:31 AM
lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
1032

I'd like a better comment here, how about:

// For floating-point values, (a-b) is the same as a+(-b). If FNEG is legal, we can defer this to operation legalization where it will be lowered as a+(-b).
1032

Also check for ISD::ADD being LegalOrCustom to match the code in LegalizeDAG.cpp.

arsenm updated this revision to Diff 87844.Feb 9 2017, 10:57 AM

Address comments

arsenm marked 2 inline comments as done.Feb 9 2017, 10:57 AM

ping

hfinkel accepted this revision.Feb 15 2017, 1:05 PM

LGTM

This revision is now accepted and ready to land.Feb 15 2017, 1:05 PM
arsenm closed this revision.Feb 15 2017, 2:14 PM

r295242