[all-commits] [llvm/llvm-project] 20c926: [mlir][DialectConversion] Do not prematurely drop ...

Stephan Herhut via All-commits all-commits at lists.llvm.org
Thu Nov 26 08:44:15 PST 2020


  Branch: refs/heads/temp-test-main
  Home:   https://github.com/llvm/llvm-project
  Commit: 20c926e0797e074bfb946d2c8ce002888ebc2bcd
      https://github.com/llvm/llvm-project/commit/20c926e0797e074bfb946d2c8ce002888ebc2bcd
  Author: Stephan Herhut <herhut at google.com>
  Date:   2020-11-26 (Thu, 26 Nov 2020)

  Changed paths:
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/test/Transforms/test-legalizer.mlir

  Log Message:
  -----------
  [mlir][DialectConversion] Do not prematurely drop unused cast operations

The rewrite logic has an optimization to drop a cast operation after
rewriting block arguments if the cast operation has no users. This is
unsafe as there might be a pending rewrite that replaced the cast operation
itself and hence would trigger a second free.

Instead, do not remove the casts and leave it up to a later canonicalization
to do so.

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




More information about the All-commits mailing list