[all-commits] [llvm/llvm-project] 0f116f: [AMDGPU] Fix infinite loop with fma combines

Austin Kerbow via All-commits all-commits at lists.llvm.org
Tue Feb 4 13:11:27 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f116fd9d86da3bb7f99f617284c3f562b6711af
      https://github.com/llvm/llvm-project/commit/0f116fd9d86da3bb7f99f617284c3f562b6711af
  Author: Austin Kerbow <Austin.Kerbow at amd.com>
  Date:   2020-02-04 (Tue, 04 Feb 2020)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
    M llvm/test/CodeGen/AMDGPU/fma-combine.ll
    M llvm/test/CodeGen/AMDGPU/fneg-combines.ll

  Log Message:
  -----------
  [AMDGPU] Fix infinite loop with fma combines

https://reviews.llvm.org/D72312 introduced an infinite loop which involves
DAGCombiner::visitFMA and AMDGPUTargetLowering::performFNegCombine.

fma( a, fneg(b), fneg(c) ) => fneg( fma (a, b, c) ) => fma( a, fneg(b), fneg(c) ) ...

This only breaks with types where 'isFNegFree' returns flase, e.g. v4f32.
Reproducing the issue also needs the attribute 'no-signed-zeros-fp-math',
and no source mods allowed on one of the users of the Op.

This fix makes changes to indicate that it is not free to negate a fma if it
has users with source mods.

Differential Revision: https://reviews.llvm.org/D73939




More information about the All-commits mailing list