Instead of sub 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 one multiplication, which gets negated and
extended, and from that the third argument is subtracted. This combiner
will transform that into two extends and one negation within the fma/fmad
instruction.
Details
Diff Detail
Event Timeline
Put back the accidentally deleted combiner from the list of combiners (load_or_combine).
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
4626–4627 | First, fadd only has as single type index. Second, I don't think there's much point in checking it's legality. It doesn't imply "LegalOperations" | |
4633 | We have a separate check for before the legalizer. FMA also only has one type index | |
4672 | Should probably be using mi_matches for all of these instead of your own getVRegDefs and nested ifs |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
4870 | Should have mi_match support for fneg/fpext and use that |
Use m_MInstr instead of m_Reg in matching patterns (mi_match).
Formatting and refactoring.
First, fadd only has as single type index. Second, I don't think there's much point in checking it's legality. It doesn't imply "LegalOperations"