Changes

Summary

  1. [llvm-reduce] Add reduction passes to reduce operands to undef/1/0 (details)
  2. [WebAssembly] Emit clangast in custom section aligned by 4 bytes (details)
  3. Implementation of `ReshapeNoopOptimization` canonicalizer. (details)
  4. Add MLIR_INSTALL_AGGREGATE_OBJECTS and default it to ON. (details)
  5. [NVPTX] Add a late SROA pass which allows optimizing away more allocas. (details)
  6. BPF: set .BTF and .BTF.ext section alignment to 4 (details)
  7. [LLDB][NFC] Remove parameter names from forward declarations from hand written expressions used in heap.py part 2 (details)
  8. [WebAssembly] Add prototype relaxed swizzle instructions (details)
Commit 9660563950aaed54020bfdf0be07e7096a9553e4 by aeubanks
[llvm-reduce] Add reduction passes to reduce operands to undef/1/0

Having non-undef constants in a final llvm-reduce output is nicer than
having undefs.

This splits the existing reduce-operands pass into three, one which does
the same as the current pass of reducing to undef, and two more to
reduce to the constant 1 and the constant 0. Do not reduce to undef if
the operand is a ConstantData, and do not reduce 0s to 1s.

Reducing GEP operands very frequently causes invalid IR (since types may
not match up if we index differently into a struct), so don't touch GEPs.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D111765
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceOperands.h
The file was modifiedllvm/test/tools/llvm-reduce/remove-operands.ll
The file was modifiedllvm/test/tools/llvm-reduce/remove-invoked-functions.ll
The file was modifiedllvm/tools/llvm-reduce/DeltaManager.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceOperands.cpp
Commit 1813fde9cc0b56cee42d9b82e6f22fa00a59cdf9 by sbc
[WebAssembly] Emit clangast in custom section aligned by 4 bytes

Emit __clangast in custom section instead of named data segment
to find it while iterating sections.
This could be avoided if all data segements (the wasm sense) were
represented as their own sections (in the llvm sense).
This can be resolved by https://github.com/WebAssembly/tool-conventions/issues/138

And the on-disk hashtable in clangast needs to be aligned by 4 bytes,
so add paddings in name length field in custom section header.

The length of clangast section name can be represented in 1 byte
by leb128, and possible maximum pads are 3 bytes, so the section
name length won't be invalid in theory.

Fixes https://bugs.llvm.org/show_bug.cgi?id=35928

Differential Revision: https://reviews.llvm.org/D74531
The file was addedclang/test/PCH/pch-wasm.c
The file was modifiedclang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
The file was modifiedllvm/lib/MC/WasmObjectWriter.cpp
The file was addedllvm/test/MC/WebAssembly/custom-section-alignment.ll
Commit 9c62bb55f473a9d0db16b894708ed09f2346ae9d by rob.suderman
Implementation of `ReshapeNoopOptimization` canonicalizer.

This canonicalizer replaces reshapes of constant tensors that contain the updated shape (skipping the reshape operation).

Differential Revision: https://reviews.llvm.org/D112038
The file was modifiedmlir/test/Dialect/Tosa/canonicalize.mlir
The file was modifiedmlir/lib/Dialect/Tosa/IR/TosaOps.cpp
Commit a897590f11b6cb2bacf6cd317a5f96b1d39ed2f2 by stellaraccident
Add MLIR_INSTALL_AGGREGATE_OBJECTS and default it to ON.

* Package maintainers can opt to disable installation of these objects.
* Per discussion on https://reviews.llvm.org/D111504

Differential Revision: https://reviews.llvm.org/D112090
The file was modifiedmlir/cmake/modules/AddMLIR.cmake
The file was modifiedmlir/cmake/modules/MLIRConfig.cmake.in
The file was modifiedmlir/CMakeLists.txt
Commit b6b7fe60a444e03387b0e8be31bc1742ead36b25 by tra
[NVPTX] Add a late SROA pass which allows optimizing away more allocas.

Fixes performance regression https://bugs.llvm.org/show_bug.cgi?id=52037

Differential Revision: https://reviews.llvm.org/D111471
The file was modifiedllvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
The file was addedllvm/test/CodeGen/NVPTX/b52037.ll
Commit cd40b5a71290bab313cc431fb9a90ac3f9f3fa02 by yhs
BPF: set .BTF and .BTF.ext section alignment to 4

Currently, .BTF and .BTF.ext has default alignment of 1.
For example,
  $ cat t.c
    int foo() { return 0; }
  $ clang -target bpf -O2 -c -g t.c
  $ llvm-readelf -S t.o
    ...
    Section Headers:
    [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
    ...
    [ 7] .BTF              PROGBITS        0000000000000000 000167 00008b 00      0   0  1
    [ 8] .BTF.ext          PROGBITS        0000000000000000 0001f2 000050 00      0   0  1

But to have no misaligned data access, .BTF and .BTF.ext
actually requires alignment of 4. Misalignment is not an issue
for architecture like x64/arm64 as it can handle it well. But
some architectures like mips may incur a trap if .BTF/.BTF.ext
is not properly aligned.

This patch explicitly forced .BTF and .BTF.ext alignment to be 4.
For the above example, we will have
    [ 7] .BTF              PROGBITS        0000000000000000 000168 00008b 00      0   0  4
    [ 8] .BTF.ext          PROGBITS        0000000000000000 0001f4 000050 00      0   0  4

Differential Revision: https://reviews.llvm.org/D112106
The file was addedllvm/test/CodeGen/BPF/BTF/align.ll
The file was modifiedllvm/lib/Target/BPF/BTFDebug.cpp
Commit 320f65ee65f40fadbd2016036e538e28ae28614c by Shafik Yaghmour
[LLDB][NFC] Remove parameter names from forward declarations from hand written expressions used in heap.py part 2

heap.py has a lot of large hand written expressions and each name in the
expression will be looked up by clang during expression parsing. For
function parameters this will be in Sema::ActOnParamDeclarator(...) in order to
catch redeclarations of parameters. The names are not needed and we have seen
some rare cases where since we don't have symbols we end up in
SymbolContext::FindBestGlobalDataSymbol(...) which may conflict with other global
symbols.

There may be a way to make this lookup smarter to avoid these cases but it is
not clear how well tested this path is and how much work it would be to fix it.
So we will go with this fix while we investigate more.

This is a second try at getting all the cases we care about.

Ref: rdar://78265641
The file was modifiedlldb/examples/darwin/heap_find/heap.py
Commit 2542bfa43a9709982ee20f8d86f905f4115c41f9 by tlively
[WebAssembly] Add prototype relaxed swizzle instructions

Add i8x16 relaxed_swizzle instructions. These are only
exposed as builtins, and require user opt-in.

Differential Revision: https://reviews.llvm.org/D112022
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
The file was modifiedclang/test/CodeGen/builtins-wasm.c
The file was modifiedclang/include/clang/Basic/BuiltinsWebAssembly.def
The file was modifiedllvm/test/MC/WebAssembly/simd-encodings.s
The file was modifiedllvm/include/llvm/IR/IntrinsicsWebAssembly.td
The file was modifiedllvm/test/CodeGen/WebAssembly/simd-intrinsics.ll
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp