AbortedChanges

Summary

  1. [lldb] Enable TestRuntimeTypes on Apple Silicon (details)
  2. [lldb] Support new objective-c hash table layout (details)
  3. Introduce alloca_scope op (details)
  4. [Sema] Address-space sensitive check for unbounded arrays (v2) (details)
  5. CodeGen: Fix missing const (details)
  6. GlobalISel: Reduce indentation and remove dead path (details)
  7. AMDGPU/GlobalISel: Fix indentation (details)
  8. AMDGPU/GlobalISel: Remove leftover hack for argument memory sizes (details)
  9. [libcxx][ranges] Add class ref_view. (details)
  10. [gn build] Port 7eba4856c702 (details)
Commit c7dee6aefd5b5f1d92d279ddd40b81217b496d50 by Jonas Devlieghere
[lldb] Enable TestRuntimeTypes on Apple Silicon
The file was modifiedlldb/test/API/lang/objc/foundation/TestRuntimeTypes.py
Commit fc71a5c6e8e8bd28e43cf58faabad6e7e2fcc652 by Jonas Devlieghere
[lldb] Support new objective-c hash table layout

Update LLDB for thew new Objective-C hash table layout in the dyld
shared cache found in macOS Monterey.

rdar://72863911
The file was modifiedlldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
The file was modifiedlldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h
The file was modifiedlldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
The file was modifiedlldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
Commit fdc0d4360b4e072bd91cdf9133fdf570d8fb16a2 by zinenko
Introduce alloca_scope op

## Introduction

This proposal describes the new op to be added to the `std` (and later moved `memref`)
dialect called `alloca_scope`.

## Motivation

Alloca operations are easy to misuse, especially if one relies on it while doing
rewriting/conversion passes. For example let's consider a simple example of two
independent dialects, one defines an op that wants to allocate on-stack and
another defines a construct that corresponds to some form of looping:

```
dialect1.looping_op {
  %x = dialect2.stack_allocating_op
}
```

Since the dialects might not know about each other they are going to define a
lowering to std/scf/etc independently:

```
scf.for … {
   %x_temp = std.alloca …
   … // do some domain-specific work using %x_temp buffer
   … // and store the result into %result
   %x = %result
}
```

Later on the scf and `std.alloca` is going to be lowered to llvm using a
combination of `llvm.alloca` and unstructured control flow.

At this point the use of `%x_temp` is bound to either be either optimized by
llvm (for example using mem2reg) or in the worst case: perform an independent
stack allocation on each iteration of the loop. While the llvm optimizations are
likely to succeed they are not guaranteed to do so, and they provide
opportunities for surprising issues with unexpected use of stack size.

## Proposal

We propose a new operation that defines a finer-grain allocation scope for the
alloca-allocated memory called `alloca_scope`:

```
alloca_scope {
   %x_temp = alloca …
   ...
}
```

Here the lifetime of `%x_temp` is going to be bound to the narrow annotated
region within `alloca_scope`. Moreover, one can also return values out of the
alloca_scope with an accompanying `alloca_scope.return` op (that behaves
similarly to `scf.yield`):

```
%result = alloca_scope {
   %x_temp = alloca …
   …
   alloca_scope.return %myvalue
}
```

Under the hood the `alloca_scope` is going to lowered to a combination of
`llvm.intr.stacksave` and `llvm.intr.strackrestore` that are going to be invoked
automatically as control-flow enters and leaves the body of the `alloca_scope`.

The key value of the new op is to allow deterministic guaranteed stack use
through an explicit annotation in the code which is finer-grain than the
function-level scope of `AutomaticAllocationScope` interface. `alloca_scope`
can be inserted at arbitrary locations and doesn’t require non-trivial
transformations such as outlining.

## Which dialect

Before memref dialect is split, `alloca_scope` can temporarily reside in `std`
dialect, and later on be moved to `memref` together with the rest of
memory-related operations.

## Implementation

An implementation of the op is available [here](https://reviews.llvm.org/D97768).

Original commits:

* Add initial scaffolding for alloca_scope op
* Add alloca_scope.return op
* Add no region arguments and variadic results
* Add op descriptions
* Add failing test case
* Add another failing test
* Initial implementation of lowering for std.alloca_scope
* Fix backticks
* Fix getSuccessorRegions implementation

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D97768
The file was modifiedmlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
The file was modifiedmlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
The file was addedmlir/test/Conversion/StandardToLLVM/convert-alloca-scope.mlir
The file was modifiedmlir/include/mlir/Dialect/MemRef/IR/MemRef.h
The file was modifiedmlir/test/Dialect/MemRef/ops.mlir
The file was modifiedmlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
Commit ce44fe199bbfd4b5a44764b678c431fdc117116a by Chris.Hamilton
[Sema] Address-space sensitive check for unbounded arrays (v2)

Check applied to unbounded (incomplete) arrays and pointers to spot
cases where the computed address is beyond the largest possible
addressable extent of the array, based on the address space in which the
array is delcared, or which the pointer refers to.

Check helps to avoid cases of nonsense pointer math and array indexing
which could lead to linker failures or runtime exceptions.  Of
particular interest when building for embedded systems with small
address spaces.

This is version 2 of this patch -- version 1 had some testing issues
due to a sign error in existing code.  That error is corrected and
lit test for this chagne is extended to verify the fix.

Originally reviewed/accepted by: aaron.ballman
Original revision: https://reviews.llvm.org/D86796

Reviewed By: aaron.ballman, ebevhan

Differential Revision: https://reviews.llvm.org/D88174
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/test/SemaCXX/constant-expression-cxx14.cpp
The file was addedclang/test/Sema/unbounded-array-bounds.c
The file was modifiedclang/test/Sema/const-eval.c
The file was modifiedclang/lib/Sema/SemaChecking.cpp
Commit 93f3c7cc3efc4911af2a7848fbae339ebbc5c3a0 by Matthew.Arsenault
CodeGen: Fix missing const
The file was modifiedllvm/lib/CodeGen/MachineFunction.cpp
The file was modifiedllvm/include/llvm/CodeGen/MachineFunction.h
Commit 9d7299b6f0ab1ff1df244151ca788904a043f5af by Matthew.Arsenault
GlobalISel: Reduce indentation and remove dead path
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Commit 6dd54dada3b1f60340078fe4e82e8a62258d8d6b by Matthew.Arsenault
AMDGPU/GlobalISel: Fix indentation
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Commit a845dc1e562c20db54018a121eb01970e76602db by Matthew.Arsenault
AMDGPU/GlobalISel: Remove leftover hack for argument memory sizes

Since the call lowering code now tries to respect the tablegen
reported argument types, this is no longer necessary.
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
Commit 7eba4856c702b1d9d0bd1d3ef58661ba6c0e58de by zoecarver
[libcxx][ranges] Add class ref_view.

Differential Revision: https://reviews.llvm.org/D102020
The file was modifiedlibcxx/include/CMakeLists.txt
The file was addedlibcxx/include/__ranges/ref_view.h
The file was addedlibcxx/test/std/ranges/range.adaptors/range.ref.view.pass.cpp
The file was modifiedlibcxx/include/ranges
Commit a67780f7db26f0b3588e9366cd6b66ec1434ab1c by llvmgnsyncbot
[gn build] Port 7eba4856c702
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn