[all-commits] [llvm/llvm-project] 875254: [mlir][Transforms][NFC] Dialect conversion: Eagerl...

Matthias Springer via All-commits all-commits at lists.llvm.org
Thu Aug 1 04:42:09 PDT 2024


  Branch: refs/heads/users/matthias-springer/eagerly_build_inverse_mapping
  Home:   https://github.com/llvm/llvm-project
  Commit: 8752547a8aa08a00ff1b26f0bd822fbb6244b530
      https://github.com/llvm/llvm-project/commit/8752547a8aa08a00ff1b26f0bd822fbb6244b530
  Author: Matthias Springer <mspringer at nvidia.com>
  Date:   2024-08-01 (Thu, 01 Aug 2024)

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

  Log Message:
  -----------
  [mlir][Transforms][NFC] Dialect conversion: Eagerly build reverse mapping

The "inverse mapping" is an inverse IRMapping that points from replaced values to their original values. This inverse mapping is needed when legalizing unresolved materializations, to figure out if a value has any uses. (It is not sufficient to examine the IR, because some IR changes have not been materialized yet.)

There was a check in `OperationConverter::finalize` that computed the inverse mapping only when needed. This check is not needed. `legalizeUnresolvedMaterializations` always computes the inverse mapping, so we can just do that in `OperationConverter::finalize` before calling `legalizeUnresolvedMaterializations`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list