This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add default action for G_FNEG
ClosedPublic

Authored by volkan on Mar 7 2017, 2:49 PM.

Details

Summary

rL297171 introduced G_FNEG for floating-point negation instruction and IRTranslator started to translate FSUB -0.0, X to FNEG X. This patch adds a default action for G_FNEG to avoid breaking existing targets.

Diff Detail

Event Timeline

volkan created this revision.Mar 7 2017, 2:49 PM
qcolombet added inline comments.Mar 7 2017, 3:16 PM
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
556

Can't we simply reuse Ty?

volkan added inline comments.Mar 7 2017, 3:22 PM
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
556

No, Ty is an instance of LLT.

qcolombet accepted this revision.Mar 7 2017, 3:27 PM
qcolombet added inline comments.
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
556

Ah right, I forgot we had to go through LLVM IR to build floating-point constant.

This revision is now accepted and ready to land.Mar 7 2017, 3:27 PM
volkan closed this revision.Mar 8 2017, 10:21 AM