Page MenuHomePhabricator

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

Authored by matejam on Mar 4 2021, 5:06 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 has a fma/fmad instruction as an operand for
the given MI. The transformed instruction has a fma/fmad instruction
inside another fma/fmad instruction.

Diff Detail

Event Timeline

matejam created this revision.Mar 4 2021, 5:06 AM
matejam requested review of this revision.Mar 4 2021, 5:06 AM
matejam updated this revision to Diff 329333.Mar 9 2021, 7:16 AM

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

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

Minor changes in CombinerHelper.cpp and in the tests.

matejam updated this revision to Diff 346790.May 20 2021, 10:28 AM

Use mi_match for comparing instructions instead of comparing the opcodes.

matejam updated this revision to Diff 349873.Jun 4 2021, 7:44 AM

Typos and refactoring.