[mlir][NFC] Add helper for common pattern of replaceAllUsesExcept
authorSean Silva <silvasean@google.com>
Wed, 12 May 2021 21:59:12 +0000 (14:59 -0700)
committerSean Silva <silvasean@google.com>
Thu, 13 May 2021 19:42:10 +0000 (12:42 -0700)
commit12874e93a15219ccfaff42a0536b2b5368c6f304
tree376c8ff65dc73e9fb5843e481de67362378d8687
parentb42fb6811e25322f7e55d3f76fe13a6829202219
[mlir][NFC] Add helper for common pattern of replaceAllUsesExcept

This covers the extremely common case of replacing all uses of a Value
with a new op that is itself a user of the original Value.

This should also be a little bit more efficient than the
`SmallPtrSet<Operation *, 1>{op}` idiom that was being used before.

Differential Revision: https://reviews.llvm.org/D102373
mlir/include/mlir/IR/Value.h
mlir/lib/Dialect/Affine/Transforms/AffineLoopNormalize.cpp
mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp
mlir/lib/IR/Value.cpp