Changes

Summary

  1. [GlobalOpt] Fix the load types when OptimizeGlobalAddressOfMalloc (details)
  2. [mlir][tosa] Shape inference for a few remaining easy cases: (details)
  3. [Compiler-rt] Fix running ASan/TSan unit tests under macOS 12.0. (details)
  4. [mlir][tosa] Tosa shape propagation for tosa.cond_if (details)
  5. [llvm-profgen][CSSPGO] Support count based aggregated type of hybrid perf script (details)
  6. [mlir][scf] Fix bug in peelForLoop (details)
  7. [AArch64][GlobalISel] Widen G_SELECT before clamping it (details)
  8. [msan] Add bsearch interceptor (details)
  9. [mlir][sparse] add example to attribute doc (details)
  10. [clangd] Add new semantic token modifier "virtual" (details)
Commit 2d9759c7902c5cbc9a7e3ab623321d5578d51687 by scui
[GlobalOpt] Fix the load types when OptimizeGlobalAddressOfMalloc

Currently, in OptimizeGlobalAddressOfMalloc, the transformation for global loads assumes that they have the same Type. With the support of ConstantExpr (https://reviews.llvm.org/D106589), this may not be true any more (as seen in the test case), and we miss the code to handle this, This is to fix that.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D107397
The file was addedllvm/test/Transforms/GlobalOpt/2021-08-03-StoreOnceLoadMultiCasts.ll
The file was modifiedllvm/lib/Transforms/IPO/GlobalOpt.cpp
Commit 143edeca6dfe5d9c006cdadb5be1ec4afd483ca3 by rob.suderman
[mlir][tosa] Shape inference for a few remaining easy cases:

Handles shape inference for identity, cast, and rescale. These were missed
during the initialy elementwise work. This includes resize shape propagation
which includes both attribute and input type based propagation.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D105845
The file was modifiedmlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
The file was modifiedmlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
The file was modifiedmlir/lib/Dialect/Tosa/IR/TosaOps.cpp
Commit b4121b335c48979716520f36445e6b01bef523cf by Dan Liew
[Compiler-rt] Fix running ASan/TSan unit tests under macOS 12.0.

On macOS the unit tests currently rely on libmalloc being used for
allocations (due to no functioning interceptors) but also having the
ASan/TSan allocator initialized in the same process.

This leads to crashes with the macOS 12.0 libmalloc nano allocator so
disable use of the allocator while running unit tests as a workaround.

rdar://80086125

Differential Revision: https://reviews.llvm.org/D107412
The file was modifiedcompiler-rt/unittests/lit.common.unit.cfg.py
Commit 1b00b94ffc2d60e07ec8e486dad0fcbcbfb99c62 by rob.suderman
[mlir][tosa] Tosa shape propagation for tosa.cond_if

We can propagate the shape from tosa.cond_if operands into the true/false
regions then through the connected blocks. Then, using the tosa.yield ops
we can determine what all possible return types are.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D105940
The file was modifiedmlir/lib/Dialect/Tosa/IR/TosaOps.cpp
The file was addedmlir/include/mlir/Dialect/Tosa/Utils/ShapeUtils.h
The file was modifiedmlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
The file was modifiedmlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
The file was modifiedmlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
Commit f1affe8dc88a27cb0d436b6ec4bd44ca5da336a9 by wlei
[llvm-profgen][CSSPGO] Support count based aggregated type of hybrid perf script

This change tried to integrate a new count based aggregated type of perf script. The only difference of the format is that an aggregated count is added at the head of the original sample which means the same samples are repeated to the given count times. This is used to reduce the perf script size.
e.g.
```
2
          4005dc
          400634
          400684
    7f68c5788793
0x4005c8/0x4005dc/P/-/-/0  ....
```
Implemented by a dedicated PerfReader `AggregatedHybridPerfReader`.

Differential Revision: https://reviews.llvm.org/D107192
The file was addedllvm/test/tools/llvm-profgen/Inputs/noinline-cs-noprobe.aggperfscript
The file was addedllvm/test/tools/llvm-profgen/Inputs/noinline-cs-pseudoprobe.aggperfscript
The file was modifiedllvm/test/tools/llvm-profgen/noinline-cs-pseudoprobe.test
The file was modifiedllvm/tools/llvm-profgen/PerfReader.h
The file was modifiedllvm/test/tools/llvm-profgen/noinline-cs-noprobe.test
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
Commit 767974f344ed0682b454a479c28284377070cf05 by springerm
[mlir][scf] Fix bug in peelForLoop

Insertion point should be set before creating new operations.

Differential Revision: https://reviews.llvm.org/D107326
The file was modifiedmlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp
Commit 564373637832b3ac2a4434c45f58c066c08e9b8c by Jessica Paquette
[AArch64][GlobalISel] Widen G_SELECT before clamping it

This allows us to handle the s88 G_SELECTS:

https://godbolt.org/z/5s18M4erY

Weird types like this can result in weird merges.

Widening to s128 first and then clamping down avoids that situation.

Differential Revision: https://reviews.llvm.org/D107415
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-select.mir
Commit 9ab590e3ebb2f4a652b4cbdd3594848e8fb017fe by Vitaly Buka
[msan] Add bsearch interceptor

Similar to qsort, bsearch can be called from non-instrumented
code of glibc. When it happends tls for arguments can be in uninitialized
state.

Unlike to qsort, bsearch does not move data, so we don't need to
check or initialize searched memory or key. Intrumented comparator will
do that on it's own.

Differential Revision: https://reviews.llvm.org/D107387
The file was addedcompiler-rt/test/sanitizer_common/TestCases/Posix/bsearch.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
The file was addedcompiler-rt/test/msan/bsearch.cpp
Commit 3fc92948734ab606e3afa68bc2c083fd3d48102a by ajcbik
[mlir][sparse] add example to attribute doc

Also makes style consistent with the "surrounding"
text that appears on one webpage in MLIR doc

Reviewed By: grosul1

Differential Revision: https://reviews.llvm.org/D107418
The file was modifiedmlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
Commit 159a26964840c456f92387c6705ffff57e7174d4 by i
[clangd] Add new semantic token modifier "virtual"

This is needed for clients that want to highlight virtual functions
differently.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D107145
The file was modifiedclang-tools-extra/clangd/SemanticHighlighting.cpp
The file was modifiedclang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
The file was modifiedclang-tools-extra/clangd/test/initialize-params.test
The file was modifiedclang-tools-extra/clangd/SemanticHighlighting.h
The file was modifiedclang-tools-extra/clangd/test/semantic-tokens.test