[PATCH] D117032: GlobalIsel: Fix fma combine when one of the uses comes from unmerge

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 09:02:37 PST 2022


Petar.Avramovic created this revision.
Petar.Avramovic added reviewers: foad, arsenm, matejam, sebastian-ne.
Herald added subscribers: kerbowa, hiraditya, rovka, nhaehnle, jvesely.
Petar.Avramovic requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Fma combine assumes that MRI.getVRegDef(Reg)->getOperand(0).getReg() = Reg
which is not true when Reg is defined by instruction with multiple defs
e.g. G_UNMERGE_VALUES.
Fix is to keep register and the instruction that defines register in
DefinitionAndSourceRegister and use when needed.


https://reviews.llvm.org/D117032

Files:
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-add-mul-post-legalize.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-add-mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117032.398976.patch
Type: text/x-patch
Size: 13288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220111/4f464b75/attachment-0001.bin>


More information about the llvm-commits mailing list