This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Lower scalable vector ISD::FNEG operations.
ClosedPublic

Authored by paulwalker-arm on Aug 23 2020, 3:29 AM.

Details

Summary

Also updates isConstOrConstSplatFP to allow the mul(A,-1) -> neg(A)
transformation when -1 is expressed as an ISD::SPLAT_VECTOR.

Diff Detail

Event Timeline

paulwalker-arm created this revision.Aug 23 2020, 3:29 AM
paulwalker-arm requested review of this revision.Aug 23 2020, 3:29 AM
paulwalker-arm added subscribers: Asif, dancgr.

@Asif & @dancgr : Sorry if you've already started looking at FNEG. It wasn't really my intension to implement support but it turned out to be the nicest way to test the isConstOrConstSplatFP change, which is required to fix an infinite legalisation hang when using fixed length vectors for SVE.

cameron.mcinally accepted this revision.Aug 24 2020, 7:14 AM
cameron.mcinally added a subscriber: arsenm.

LGTM

There is a subtle wrong answers bug with this transform, but it's something that's under development separately. That is, FMUL(X,-1.0) != FNEG(X) when FTZ is enabled. We have a flag for checking the denormal mode, namely DenormalMode. We can address it later though. @arsenm

This revision is now accepted and ready to land.Aug 24 2020, 7:14 AM
This revision was automatically updated to reflect the committed changes.