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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Put back the accidentally deleted combiner from the list of combiners (load_or_combine).
Use m_MInstr instead of m_Reg in matching patterns (mi_match).
A few minor bug fixes.
Formatting and refactoring.
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
5063 | Use B not Builder. Same for everywhere else below. | |
5076–5080 | These are fpext for X and Y which do not happen in this pattern. Just remove these lines. | |
5113–5117 | You already checked above for m_GFPExt(m_MInstr(FMAMI)) | |
5149–5152 | (same as first fold) | |
5186–5189 | (same as second fold) |
Put this after canCombineFMadOrFMA call and !Agressive check