Page MenuHomePhabricator

[AMDGPU][GlobalISel] Transform (fadd (fpext (fmul x, y)), z) -> (fma (fpext x), (fpext y), z)
Needs ReviewPublic

Authored by matejam on Mar 4 2021, 5:03 AM.

Details

Summary

Instead of add and mul instructions, use v_mad, v_mac or v_fma if fma
instructions are faster and are legal for the given architecture.
Combiner for a case that adds two function arguments, extends the result
and multiplies it with the third function argument, and transforms that
into extend instructions combined with some of the fma instruction
depending on the architecture.

Diff Detail

Event Timeline

matejam created this revision.Mar 4 2021, 5:03 AM
matejam requested review of this revision.Mar 4 2021, 5:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2021, 5:03 AM
Herald added a subscriber: wdng. · View Herald Transcript
matejam updated this revision to Diff 329332.Mar 9 2021, 7:15 AM

Put back the accidentally deleted combiner from the list of combiners (load_or_combine).

matejam updated this revision to Diff 343371.May 6 2021, 5:46 AM

Minor changes in CombinerHelper.cpp and in the tests.

matejam updated this revision to Diff 346791.May 20 2021, 10:29 AM

Use mi_match for comparing instructions instead of comparing the opcodes.

matejam updated this revision to Diff 348221.May 27 2021, 4:20 AM

A few minor changes (removal of unnecessary comments).