[all-commits] [llvm/llvm-project] 89cd34: [mlir][LLVM] Use int32_t to indirectly construct G...

Andrei Golubev via All-commits all-commits at lists.llvm.org
Fri Jan 26 05:28:03 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89cd345667a5f8f4c37c621fd8abe8d84e85c050
      https://github.com/llvm/llvm-project/commit/89cd345667a5f8f4c37c621fd8abe8d84e85c050
  Author: Andrei Golubev <andrey.golubev at intel.com>
  Date:   2024-01-26 (Fri, 26 Jan 2024)

  Changed paths:
    M mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
    M mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
    M mlir/lib/Dialect/LLVMIR/Transforms/TypeConsistency.cpp

  Log Message:
  -----------
  [mlir][LLVM] Use int32_t to indirectly construct GEPArg (#79562)

GEPArg can only be constructed from int32_t and mlir::Value. Explicitly
cast other types (e.g. unsigned, size_t) to int32_t to avoid narrowing
conversion warnings on MSVC. Some recent examples of such are:

```
mlir\lib\Dialect\LLVMIR\Transforms\TypeConsistency.cpp: error C2398:
Element '1': conversion from 'size_t' to 'T' requires a narrowing
conversion
    with
    [
        T=mlir::LLVM::GEPArg
    ]

mlir\lib\Dialect\LLVMIR\Transforms\TypeConsistency.cpp: error C2398:
Element '1': conversion from 'unsigned int' to 'T' requires a narrowing
conversion
    with
    [
        T=mlir::LLVM::GEPArg
    ]
```

Co-authored-by: Nikita Kudriavtsev <nikita.kudriavtsev at intel.com>




More information about the All-commits mailing list