[all-commits] [llvm/llvm-project] 2c12a0: [ISel] Fix DAG divergence after new FMA combine

Jay Foad via All-commits all-commits at lists.llvm.org
Wed Sep 28 11:45:00 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c12a04bba76e88259b3fae2cf7ce6f033a953ff
      https://github.com/llvm/llvm-project/commit/2c12a04bba76e88259b3fae2cf7ce6f033a953ff
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll

  Log Message:
  -----------
  [ISel] Fix DAG divergence after new FMA combine

D132837 introduced a new DAG combine that used MorphNodeTo to morph an
FMUL into an FMA. It turns out that MorphNodeTo does not properly update
the divergence bit for users of the morphed node, causing an assertion
failure on the new test case:

llc: SelectionDAG.cpp:10486: void llvm::SelectionDAG::VerifyDAGDivergence(): Assertion `calculateDivergence(N) == N->isDivergent() && "Divergence bit inconsistency detected"' failed.

Fixing MorphNodeTo to propagate the divergence bit is tricky because of
the way it is used to select machine instructions, so use getNode and
ReplaceAllUsesOfValueWith instead.

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




More information about the All-commits mailing list