SuccessChanges

Summary

  1. [OpenMP] Add experimental nesting mode feature (details)
  2. [Windows SEH]: Fix -O2 crash for Windows -EHa (details)
  3. [flang][OpenMP] Add semantic check to allow only loop iteration variables in a `linear` clause within `distribute` construct. (details)
  4. [flang] Check for undefined derived types (details)
  5. [X86] AMD Zen 3: double the LoopMicroOpBufferSize (details)
  6. [ADT] Refactor enumerate unit tests (details)
  7. Revert "Add memref.dim canonicalization patterns to TilingCanonicalizationPatterns" (details)
  8. Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always). (details)
  9. [mlir][tosa] Update tosa.rescale for i48 input type (details)
  10. fix SANITIZE_WINDOWS pragma for https://reviews.llvm.org/rG60e5243e593ec7e0feca42783edb735e9ac2c4a7 (details)
  11. [gn build] manually port 60e5243e593e (weak asan symbol) (details)
  12. [mlir][sparse] add option for 32-bit indices in scatter/gather (details)
  13. remove windows tests for -asan_use-after-return=always (as this is currently disabled for Windows) (details)
Commit 8ec9aa236e325fd4629cfeefac2919302e14d61a by terry.l.wilmarth
[OpenMP] Add experimental nesting mode feature

Nesting mode is a new experimental feature in the OpenMP
runtime. It allows a user to set up nesting for an application in a
way that corresponds to the hardware topology levels on the machine an
application is being run on.  For example, if a machine has 2 sockets,
each with 12 cores, then use of nesting mode could set up an outer
level of nesting that uses 2 threads per parallel region, and an inner
level of nesting that uses 12 threads per parallel region.

Nesting mode is controlled with the KMP_NESTING_MODE environment
variable as follows:

1) KMP_NESTING_MODE = 0: Nesting mode is off (default); max-active-levels-var
is set to 1 (the default -- nesting is off, nested parallel regions
are serialized).

2) KMP_NESTING_MODE = 1: Nesting mode is on, and a number of threads
will be assigned for each level discovered in the machine topology;
max-active-levels-var is set to the number of levels discovered.

3) KMP_NESTING_MODE = n, n>1: [Note: this option is experimental and may change
or be removed in the future.] Nesting mode is on, and a number of
threads will be assigned for each topology level discovered on the
machine, up to k<=n levels (since there may be fewer than n levels
discovered in the topology), and beyond the kth level, nested parallel
regions will be serialized; NOTE: max-active-levels-var is 1 (the default --
nesting is off, and nested parallel regions are serialized until the
user changes max-active-levels-var.

If the user sets OMP_NUM_THREADS or OMP_MAX_ACTIVE_LEVELS, they will
override KMP_NESTING_MODE settings for the associated environment
variables. The detected topology may be limited by an affinity mask
setting on the initial thread, or if the user sets KMP_HW_SUBSET. See
also: KMP_HOT_TEAMS_MAX_LEVEL for controlling use of hot teams for
nested parallel regions. Note that this feature only sets numbers of
threads used at nesting levels.  The user should make use of
OMP_PLACES and OMP_PROC_BIND or KMP_AFFINITY for affinitizing those
threads, if desired.

Differential Revision: https://reviews.llvm.org/D102188
The file was modifiedopenmp/runtime/src/kmp_runtime.cpp
The file was modifiedopenmp/runtime/src/kmp.h
The file was modifiedopenmp/runtime/src/kmp_ftn_entry.h
The file was modifiedopenmp/runtime/src/kmp_global.cpp
The file was modifiedopenmp/runtime/src/kmp_settings.cpp
Commit 33ba8bd2c942062731a17e1b864b5953e3d79f1a by tentzen
[Windows SEH]: Fix -O2 crash for Windows -EHa

This patch fixes a Windows -EHa crash induced by previous commit 797ad701522988e212495285dade8efac41a24d4.
The crash was caused by "LifetimeMarker" scope (with option -O2) that should not be considered as SEH Scope.

This change also turns off -fasync-exceptions by default under -EHa option for now.

Differential Revision: https://reviews.llvm.org/D103664#2799944
The file was modifiedclang/lib/CodeGen/CGCleanup.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
Commit f2622a150adea31290daee0d04bf385d387fbc04 by arnamoy.bhattacharyya
[flang][OpenMP] Add semantic check to allow only loop iteration variables in a `linear` clause within `distribute` construct.

Implement the following semantic check:

"A list item may not appear in a linear clause, unless it is the loop iteration variable."

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D100224
The file was modifiedflang/lib/Semantics/check-omp-structure.h
The file was modifiedflang/lib/Semantics/check-omp-structure.cpp
The file was addedflang/test/Semantics/omp-linear-iter.f90
Commit 2b795ec682ff4a9afbfe4e5c102a51689b270ecc by psteinfeld
[flang] Check for undefined derived types

It's possible to specify refer to an undefined derived type as the type of a
component of another derived type and then never define the type of the
component.  We were not detecting this situation.  To fix this, I
changed the value of isForwardReferenced_ in the symbol's
DerivedTypeDetails and checked for it when performing other derived type
checks.

I also had to record the fact that error messages were previously
emitted for the same problem in some cases so that I could avoid
duplicate messages.

I also added a test.

Differential Revision: https://reviews.llvm.org/D103714
The file was modifiedflang/lib/Semantics/resolve-names.cpp
The file was modifiedflang/test/Semantics/bad-forward-type.f90
The file was modifiedflang/lib/Semantics/type.cpp
The file was modifiedflang/lib/Semantics/check-declarations.cpp
The file was modifiedflang/include/flang/Semantics/symbol.h
Commit 852497711dae35f978a7a3f2e1889fc8fe15fc3b by lebedev.ri
[X86] AMD Zen 3: double the LoopMicroOpBufferSize

While the IndVars issue (PR50384) has been resolved,
and the compile performance improved, a new blocker emerged,
the codegen machine instruction scheduling is also quadratic.
So we still can't really specify the right value here.

Filed PR50584.
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td
Commit e17610cf9627fa8d0a9ee234d0e5c43b5afd2d8e by scott.linder
[ADT] Refactor enumerate unit tests

Preparation for landing the tests for llvm::makeVisitor, including
breaking out the a "Counted" base class and explicitly testing
the prvalue case as distinct from the rvalue case.

Differential Revision: https://reviews.llvm.org/D103206
The file was modifiedllvm/unittests/ADT/STLExtrasTest.cpp
Commit bba8d8c1868da41c2fa8c39b8ef0a4aefd97b990 by ataei
Revert "Add memref.dim canonicalization patterns to TilingCanonicalizationPatterns"

This reverts commit a52959401d9544ac7037405aaf714bd08f071ea9.

Differential Revision: https://reviews.llvm.org/D103724
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
Commit 60e5243e593ec7e0feca42783edb735e9ac2c4a7 by kda
Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).

In addition:
  - optionally add global flag to capture compile intent for UAR:
    __asan_detect_use_after_return_always.
    The global is a SANITIZER_WEAK_ATTRIBUTE.

for issue: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D103304
The file was modifiedcompiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
The file was modifiedcompiler-rt/lib/asan/asan_interface.inc
The file was modifiedcompiler-rt/test/asan/TestCases/pass-struct-byval-uar.cpp
The file was modifiedcompiler-rt/lib/asan/asan_rtl.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
The file was modifiedcompiler-rt/lib/asan/weak_symbols.txt
The file was modifiedllvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/Linux/uar_signals.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/scariness_score_test.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/uar_and_exceptions.cpp
The file was modifiedllvm/test/Instrumentation/AddressSanitizer/fake-stack.ll
The file was modifiedcompiler-rt/test/asan/TestCases/heavy_uar_test.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp
Commit d86ef4364fb50728a2b87ec67bd2714d759f72a4 by rob.suderman
[mlir][tosa] Update tosa.rescale for i48 input type

i48 integers require slightly tweaked behavior, specifically supporting zero
point offsetting with slightly higher bitdepth. Updated results lowering
appropriately.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D102659
The file was modifiedmlir/test/Conversion/TosaToStandard/tosa-to-standard.mlir
The file was modifiedmlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
The file was modifiedmlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
The file was modifiedmlir/lib/Conversion/TosaToStandard/TosaToStandard.cpp
Commit 26b3ea224e7744058c0053e8eee25a8a3acc9f5d by kda
fix SANITIZE_WINDOWS pragma for https://reviews.llvm.org/rG60e5243e593ec7e0feca42783edb735e9ac2c4a7
The file was modifiedcompiler-rt/lib/asan/asan_rtl.cpp
Commit 00542932fe13ea3b989f40b434399c72f5eca4ec by thakis
[gn build] manually port 60e5243e593e (weak asan symbol)
The file was modifiedllvm/utils/gn/secondary/compiler-rt/lib/asan/BUILD.gn
Commit 86e9bc1a34a0eafcce52c0dfda0817b1465a0dc2 by ajcbik
[mlir][sparse] add option for 32-bit indices in scatter/gather

Controlled by a compiler option, if 32-bit indices can be handled
with zero/sign-extention alike (viz. no worries on non-negative
indices), scatter/gather operations can use the more efficient
32-bit SIMD version.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D103632
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
The file was modifiedmlir/test/Dialect/SparseTensor/sparse_vector.mlir
The file was modifiedmlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.h
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
The file was modifiedmlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.td
Commit 17600ec32a6f3e5720e5232ddb23d67daa650f4d by kda
remove windows tests for -asan_use-after-return=always (as this is currently disabled for Windows)
The file was modifiedcompiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cpp