[all-commits] [llvm/llvm-project] 6937db: [mlir][memref] Fix `alloca` lowering with 0 dimens...

Matthias Springer via All-commits all-commits at lists.llvm.org
Fri Oct 4 08:32:54 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6937dbbe51391471f3cf50fe2b8fa2cd14080a3b
      https://github.com/llvm/llvm-project/commit/6937dbbe51391471f3cf50fe2b8fa2cd14080a3b
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-10-04 (Fri, 04 Oct 2024)

  Changed paths:
    M mlir/lib/Conversion/LLVMCommon/Pattern.cpp
    M mlir/test/Conversion/MemRefToLLVM/convert-static-memref-ops.mlir

  Log Message:
  -----------
  [mlir][memref] Fix `alloca` lowering with 0 dimensions (#111119)

The `memref.alloca` lowering computed the allocation size incorrectly
when there were 0 dimensions.

Previously:
```
memref.alloca() : memref<10x0x2xf32>
--> llvm.alloca 20xf32
```

Now:
```
memref.alloca() : memref<10x0x2xf32>
--> llvm.alloca 0xf32
```

>From the `llvm.alloca` documentation:
```
Allocating zero bytes is legal, but the returned pointer may not be unique.
```



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