This is an archive of the discontinued LLVM Phabricator instance.

DAG: Handle expanding strict_fsub into fneg and strict_fadd
ClosedPublic

Authored by arsenm on May 27 2020, 7:06 AM.

Details

Summary

The AMDGPU handling of f16 vectors is terrible still since it gets
scalarized even when the vector operation is legal.

The code is is essentially duplicated between the non-strict and
strict case. Apparently no other expansions are currently trying to do
this. This is mostly because I found the behavior of
getStrictFPOperationAction to be confusing. In the ARM case, it would
expand strict_fsub even though it shouldn't due to the later check. At
that point, the logic required to check for legality was more complex
than just duplicating the 2 instruction expansion.

Diff Detail

Event Timeline

arsenm created this revision.May 27 2020, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2020, 7:06 AM
arsenm updated this revision to Diff 266530.May 27 2020, 7:09 AM

Fix losing flags

This revision is now accepted and ready to land.May 27 2020, 11:25 AM
arsenm planned changes to this revision.Jun 5 2020, 6:44 AM

Breaks AArch64/ARM tests which start expanding strict_fsub instead of directly selecting it

arsenm updated this revision to Diff 277087.Jul 10 2020, 10:17 AM
arsenm edited the summary of this revision. (Show Details)

Fix ARM/AArch64 tests by duplicating the logic rather than adding all the logic to account for getStrictFPOperationAction

This revision is now accepted and ready to land.Jul 10 2020, 10:17 AM
arsenm requested review of this revision.Jul 10 2020, 10:17 AM
This revision is now accepted and ready to land.Jul 21 2020, 11:44 AM