Page MenuHomePhabricator

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

Authored by matejam on Mar 5 2021, 7:39 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 in which two function arguments are multiplied, the
result of the multiplication gets extended, which gets added to the
result of the multiplication of another two arguments, and the result
of that gets added to the last function argument. The result of the
combiner will be a fma instruction within a fma instruction.

Diff Detail

Event Timeline

matejam created this revision.Mar 5 2021, 7:39 AM
matejam requested review of this revision.Mar 5 2021, 7:39 AM
matejam updated this revision to Diff 329334.Mar 9 2021, 7:17 AM

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

matejam updated this revision to Diff 343373.May 6 2021, 5:47 AM

Minor changes in CombinerHelper.cpp and in the tests.

matejam updated this revision to Diff 346788.May 20 2021, 10:27 AM

Use mi_match for comparing instructions instead of comparing the opcodes.

matejam updated this revision to Diff 349872.Jun 4 2021, 7:43 AM

Typos and refactoring.