[all-commits] [llvm/llvm-project] e4635e: [mlir][FoldUtils] Ensure the created constant domi...

River Riddle via All-commits all-commits at lists.llvm.org
Mon Aug 23 11:52:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e4635e6328c88f1f403b316bd8340fe03f9835a8
      https://github.com/llvm/llvm-project/commit/e4635e6328c88f1f403b316bd8340fe03f9835a8
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-08-23 (Mon, 23 Aug 2021)

  Changed paths:
    M mlir/lib/Transforms/Utils/FoldUtils.cpp
    M mlir/test/Transforms/test-operation-folder.mlir
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  [mlir][FoldUtils] Ensure the created constant dominates the replaced op

This revision fixes a bug where an operation would get replaced with
a pre-existing constant that didn't dominate it. This can occur when
a pattern inserts operations to be folded at the beginning of the
constants insertion block. This revision fixes the bug by moving the
existing constant before the replaced operation in such cases. This is
fine because if a constant didn't already exist, a new one would have
been inserted before this operation anyways.

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




More information about the All-commits mailing list