[all-commits] [llvm/llvm-project] e0d5a7: [mlir][IR] Fix overload resolution on MSVC build

Matthias Springer via All-commits all-commits at lists.llvm.org
Fri Mar 8 16:44:04 PST 2024


  Branch: refs/heads/users/matthias-springer/msvc_overloads
  Home:   https://github.com/llvm/llvm-project
  Commit: e0d5a7c10234d19758f5373f2b73cae7a5740017
      https://github.com/llvm/llvm-project/commit/e0d5a7c10234d19758f5373f2b73cae7a5740017
  Author: Matthias Springer <springerm at google.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/Transforms/Utils/RegionUtils.cpp

  Log Message:
  -----------
  [mlir][IR] Fix overload resolution on MSVC build

#82629 added additional overloads to `replaceAllUsesWith` and `replaceUsesWithIf`. This caused a build breakage with MSVC when called with ops that can implicitly convert to `Value`.

```
external/llvm-project/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp(881): error C2666: 'mlir::RewriterBase::replaceAllUsesWith': 2 overloads have similar conversions
external/llvm-project/mlir/include\mlir/IR/PatternMatch.h(631): note: could be 'void mlir::RewriterBase::replaceAllUsesWith(mlir::Operation *,mlir::ValueRange)'
external/llvm-project/mlir/include\mlir/IR/PatternMatch.h(626): note: or       'void mlir::RewriterBase::replaceAllUsesWith(mlir::ValueRange,mlir::ValueRange)'
external/llvm-project/mlir/include\mlir/IR/PatternMatch.h(616): note: or       'void mlir::RewriterBase::replaceAllUsesWith(mlir::Value,mlir::Value)'
external/llvm-project/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp(882): note: while trying to match the argument list '(mlir::tensor::ExtractSliceOp, T)'
        with
        [
            T=mlir::Value
        ]
```

Note: The LLVM build bots (Linux and Windows) did not break, this seems to be an issue with `Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe`.

This change renames the newly added overloads to `replaceAllOpUsesWith` and `replaceOpUsesWithIf`.



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