[all-commits] [llvm/llvm-project] 0ad6ac: [NFC][MLIR] Fix: `alloca` promotion for `Allocatio...

Nikhil Kalra via All-commits all-commits at lists.llvm.org
Wed Jul 3 23:49:54 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ad6ac8c5338e42192bc006576397a02b838d265
      https://github.com/llvm/llvm-project/commit/0ad6ac8c5338e42192bc006576397a02b838d265
  Author: Nikhil Kalra <1368497+nikalra at users.noreply.github.com>
  Date:   2024-07-04 (Thu, 04 Jul 2024)

  Changed paths:
    M mlir/lib/Dialect/Bufferization/Transforms/BufferOptimizations.cpp

  Log Message:
  -----------
  [NFC][MLIR] Fix: `alloca` promotion for `AllocationOpInterface` (#97672)

The std::optional returned by buildPromotedAlloc was directly
dereferenced and assumed to be non-null, even though the documentation
for AllocationOpInterface indicates that std::nullopt is a legal value
if buffer stack promotion is not supported (and is the default value
supplied by the TableGen interface file). This patch removes the direct
dereference so that the optional can be null-checked prior to use.

Co-authored-by: Nikhil Kalra <nkalra at apple.com>



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