Changes

Summary

  1. [mlir][sparse] refine simply dynamic sparse tensor outputs (details)
  2. [flang] Correct INQUIRE(POSITION= & PAD=) (details)
  3. [NFC] Refactor symbol table parsing. (details)
  4. [InstCombine] Allow fake vector insert folding to bit-logic only if the insert element is integer type (details)
  5. [NFC][sanitizer] Fail test quickly (details)
  6. [ADT] Remove 0-width Asserts in APInt.getZExtValue (details)
  7. [flang] Define & implement a lowering support API IsContiguous() in runtime (details)
  8. [OpenMP][libomp][doc] Add environment variables documentation (details)
  9. [TSan][Darwin] Avoid crashes due to interpreting non-zero shadow content as a pointer (details)
  10. Big-endian version of vpermxor (details)
  11. [NFC][regalloc] Factor accesses to ExtraRegInfo (details)
  12. [Clang] Add option to disable -mconstructor-aliases with -mno-constructor-aliases (details)
  13. Revert "[MLIR] Update Vector To LLVM conversion to be aware of assume_alignment" (details)
  14. [flang] Rearrange prototype & code placement of IsCoarray() (details)
  15. [mlir][sparse] fix typos in integration tests (details)
  16. [runtimes][openmp] Change to not treat ARCH-unknown-linux-gnu as errors (details)
  17. [FS-AFDO][llvm-profgen] Generate profile with FS-AFDO discriminator (details)
  18. [ObjectYAML/obj2yaml/yaml2obj][MachO] Support indirect symbol table (details)
  19. [llvm-profgen] Truncate the context with zero probe ID (details)
  20. [mlir][sparse] added sparse out element wise mult integration test (details)
  21. [NFC][sanitizer] Add entry point for compression (details)
  22. [test] Avoid dumping .o in source tree (expand-pseudos.ll) (details)
Commit 0e85232fa39dbe54b13b40320460dd4f945b29fd by ajcbik
[mlir][sparse] refine simply dynamic sparse tensor outputs

Proper test for sparse tensor outputs is a single condition throughout
the whole tensor index expression (not a general conjunction, since this
may include other conditions that cause cancellation).

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D114810
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
The file was modifiedmlir/test/Dialect/SparseTensor/sparse_out.mlir
The file was modifiedmlir/lib/Dialect/SparseTensor/Utils/Merger.cpp
The file was modifiedmlir/include/mlir/Dialect/SparseTensor/Utils/Merger.h
Commit 80cdf0db67e2c0f231f4fefc2b873690b44f84cc by pklausler
[flang] Correct INQUIRE(POSITION= & PAD=)

INQUIRE(POSITION=)'s results need to reflect the POSITION=
specifier used for the OPEN statement until the unit has been
repositioned.  Preserve the POSITION= from OPEN and used it
for INQUIRE(POSITION=) until is becomes obsolete.

INQUIRE(PAD=) is implemented here in the case of an unconnected unit
with Fortran 2018 semantics; i.e., "UNDEFINED", rather than Fortran 90's
"YES"/"NO" (see 4.3.6 para 2).  Apparent failures with F'90-only tests
will persist with INQUIRE(PAD=); these discrepancies don't seem to warrant
an option or environment variable.

To make the implementation of INQUIRE more closely match the language
in the standard, rename IsOpen() to IsConnected(), and use it explicitly
for the various INQUIRE specifiers.

Differential Revision: https://reviews.llvm.org/D114755
The file was modifiedflang/runtime/file.h
The file was modifiedflang/runtime/file.cpp
The file was modifiedflang/runtime/unit.cpp
The file was modifiedflang/runtime/connection.h
The file was modifiedflang/runtime/io-stmt.cpp
The file was modifiedflang/runtime/unit.h
Commit 7e6df41f655e51c984b92bbd9c19a6fb851f35d4 by gclayton
[NFC] Refactor symbol table parsing.

Symbol table parsing has evolved over the years and many plug-ins contained duplicate code in the ObjectFile::GetSymtab() that used to be pure virtual. With this change, the "Symbtab *ObjectFile::GetSymtab()" is no longer virtual and will end up calling a new "void ObjectFile::ParseSymtab(Symtab &symtab)" pure virtual function to actually do the parsing. This helps centralize the code for parsing the symbol table and allows the ObjectFile base class to do all of the common work, like taking the necessary locks and creating the symbol table object itself. Plug-ins now just need to parse when they are asked to parse as the ParseSymtab function will only get called once.

This is a retry of the original patch https://reviews.llvm.org/D113965 which was reverted. There was a deadlock in the Manual DWARF indexing code during symbol preloading where the module was asked on the main thread to preload its symbols, and this would in turn cause the DWARF manual indexing to use a thread pool to index all of the compile units, and if there were relocations on the debug information sections, these threads could ask the ObjectFile to load section contents, which could cause a call to ObjectFileELF::RelocateSection() which would ask for the symbol table from the module and it would deadlock. We can't lock the module in ObjectFile::GetSymtab(), so the solution I am using is to use a llvm::once_flag to create the symbol table object once and then lock the Symtab object. Since all APIs on the symbol table use this lock, this will prevent anyone from using the symbol table before it is parsed and finalized and will avoid the deadlock I mentioned. ObjectFileELF::GetSymtab() was never locking the module lock before and would put off creating the symbol table until somewhere inside ObjectFileELF::GetSymtab(). Now we create it one time inside of the ObjectFile::GetSymtab() and immediately lock it which should be safe enough. This avoids the deadlocks and still provides safety.

Differential Revision: https://reviews.llvm.org/D114288
The file was modifiedlldb/include/lldb/Symbol/Symtab.h
The file was modifiedlldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
The file was modifiedlldb/source/Symbol/Symtab.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
The file was modifiedlldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
The file was modifiedlldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h
The file was modifiedlldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
The file was modifiedlldb/include/lldb/Symbol/ObjectFile.h
The file was modifiedlldb/source/Core/Module.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
The file was modifiedlldb/source/Symbol/ObjectFile.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
The file was modifiedlldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
The file was modifiedlldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
Commit 9e3e1aad3161f4ce5301c3a59c7313ad83240a6d by daniel_l_sanders
[InstCombine] Allow fake vector insert folding to bit-logic only if the insert element is integer type

The below commit is causing assertion when insert element type is not integer
type such as half. This is because the transformation is creating zext before
doing bitwise OR, and the zext is supported only for integer types
https://github.com/llvm/llvm-project/commit/80ab06c599a0f5a90951c36a57b2a9b492b19d61

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D114734
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was modifiedllvm/test/Transforms/InstCombine/bitcast-inselt-bitcast.ll
Commit aeeacbd989fc474d920afa1b1dd3fb4ef502c726 by Vitaly Buka
[NFC][sanitizer] Fail test quickly
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_stack_store_test.cpp
Commit 63f417ef39963afa9722a7b3c5cf3b28a9d41883 by schuyler.eldridge
[ADT] Remove 0-width Asserts in APInt.getZExtValue

Remove assertion that disallows getting a zero-extended value from a
zero-width APInt.  This check is too restrictive and makes it difficult
to use APInt to model zero-width things, e.g., zero-width wires in the
CIRCT project.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>

Reviewed By: lattner, darthscsi, nikic

Differential Revision: https://reviews.llvm.org/D114768
The file was modifiedllvm/unittests/ADT/APIntTest.cpp
The file was modifiedllvm/include/llvm/ADT/APInt.h
Commit 77ff6f7df8691a735a2dc979cdb44835dd2d41af by pklausler
[flang] Define & implement a lowering support API IsContiguous() in runtime

Create a new flang/runtime/support.cpp module to hold miscellaneous
runtime APIs to support lowering, and define an API IsContiguous() to
wrap the member function predicate Descriptor::IsContiguous().
And do a little clean-up of other API headers that don't need to expose
Runtime/descriptor.h.

Differential Revision: https://reviews.llvm.org/D114752
The file was modifiedflang/runtime/transformational.cpp
The file was modifiedflang/include/flang/Runtime/reduction.h
The file was addedflang/include/flang/Runtime/support.h
The file was modifiedflang/include/flang/Runtime/transformational.h
The file was modifiedflang/runtime/terminator.h
The file was modifiedflang/runtime/CMakeLists.txt
The file was modifiedflang/runtime/reduction.cpp
The file was addedflang/runtime/support.cpp
Commit 618f8dc5e5b53aeff3261fcf6cebba3666849b10 by jonathan.l.peyton
[OpenMP][libomp][doc] Add environment variables documentation

Add documentation for the environment variables for libomp

Differential Revision: https://reviews.llvm.org/D114269
The file was modifiedopenmp/docs/design/Runtimes.rst
Commit 858eb8fc11e2e683ef1cef956ac102bfc5f0a1a8 by julian.lettner
[TSan][Darwin] Avoid crashes due to interpreting non-zero shadow content as a pointer

We would like to use TLS to store the ThreadState object (or at least a
reference ot it), but on Darwin accessing TLS via __thread or manually
by using pthread_key_* is problematic, because there are several places
where interceptors are called when TLS is not accessible (early process
startup, thread cleanup, ...).

Previously, we used a "poor man's TLS" implementation, where we use the
shadow memory of the pointer returned by pthread_self() to store a
pointer to the ThreadState object.

The problem with that was that certain operations can populate shadow
bytes unbeknownst to TSan, and we later interpret these non-zero bytes
as the pointer to our ThreadState object and crash on when dereferencing
the pointer.

This patch changes the storage location of our reference to the
ThreadState object to "real" TLS.  We make this work by artificially
keeping this reference alive in the pthread_key destructor by resetting
the key value with pthread_setspecific().

This change also fixes the issue were the ThreadState object is
re-allocated after DestroyThreadState() because intercepted functions
can still get called on the terminating thread after the
THREAD_TERMINATE event.

Radar-Id: rdar://problem/72010355

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D110236
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
Commit 0850655da69a700b7def4fe8d9a44d1c8d55877c by wyehia
Big-endian version of vpermxor

A big-endian version of vpermxor, named vpermxor_be, is added to LLVM
and Clang. vpermxor_be can be called directly on both the little-endian
and the big-endian platforms.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D114540
The file was modifiedllvm/include/llvm/IR/IntrinsicsPowerPC.td
The file was modifiedclang/include/clang/Basic/BuiltinsPPC.def
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrVSX.td
The file was modifiedclang/test/CodeGen/builtins-ppc-crypto.c
The file was addedllvm/test/CodeGen/PowerPC/crypto_bifs_be.ll
Commit a503cb00d105b75744444c987fd159b05180c383 by mtrofin
[NFC][regalloc] Factor accesses to ExtraRegInfo

We'll move ExtraRegInfo to the RegAllocEvictionAdvisor subsequently.
This change prepares for that by factoring all accesses.

RFC: https://lists.llvm.org/pipermail/llvm-dev/2021-November/153639.html

Differential Revision: https://reviews.llvm.org/D114759
The file was modifiedllvm/lib/CodeGen/RegAllocGreedy.cpp
Commit 9b704d31b54a61615e7d172a1ed040bff7423e9b by modimo
[Clang] Add option to disable -mconstructor-aliases with -mno-constructor-aliases

We've found that when profiling, counts are only generated for the real definition of constructor aliases (C2 in mangled name). However, when compiling the C1 version is present at the callsite and leads to a lack of counts due to this aliasing. This causes us to miss out on inlining an otherwise hot constructor.

-mconstructor-aliases is AFAICT an optimization, so having a disabling flag if wanted seems valuable.

Testing:
ninja check-all

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D114130
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/CodeGenCXX/constructor-alias.cpp
Commit 73863648892ee7063c7fd4e658d7614fd721504a by stephen.neuendorffer
Revert "[MLIR] Update Vector To LLVM conversion to be aware of assume_alignment"

This reverts commit 29a50c5864ddab283c1ff38694fb5926ce37b39a.

After LLVM lowering, the original patch incorrectly moved alignment
information across an unconstrained GEP operation.  This is only correct
for some index offsets in the GEP.  It seems that the best approach is,
in fact, to rely on LLVM to propagate information from the llvm.assume()
to users.

Thanks to Thomas Raoux for catching this.
The file was modifiedmlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
The file was modifiedmlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
Commit 1ee6f7add1ca824de4337991304ff737b953a968 by pklausler
[flang] Rearrange prototype & code placement of IsCoarray()

A quick fix last week to the shared library build caused
the predicate IsCoarray(const Symbol &) to be moved from
Semantics to Evaluate.  This patch completes that move in
a way that properly combines the existing IsCoarray() tests
for expressions and other object with the test for a symbol.

Differential Revision: https://reviews.llvm.org/D114806
The file was modifiedflang/lib/Semantics/check-allocate.cpp
The file was modifiedflang/lib/Semantics/tools.cpp
The file was modifiedflang/lib/Semantics/check-declarations.cpp
The file was modifiedflang/lib/Semantics/check-do-forall.cpp
The file was modifiedflang/include/flang/Evaluate/tools.h
The file was modifiedflang/lib/Evaluate/tools.cpp
The file was modifiedflang/lib/Semantics/resolve-names.cpp
Commit fe0508dc9d42201128a5b9016350e31b0ab41a79 by ajcbik
[mlir][sparse] fix typos in integration tests

Reviewed By: bixia, wrengr

Differential Revision: https://reviews.llvm.org/D114820
The file was modifiedmlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir
The file was modifiedmlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_reduction.mlir
Commit 5e2358c781b85a18d1463fd924d2741d4ae5e42e by marukawa
[runtimes][openmp] Change to not treat ARCH-unknown-linux-gnu as errors

When OpenMP is compiled as a part runtimes for multiple targets, openmp
is compiled under build/runtimes/runtimes-arch-unknown-linux-gnu-bins
directory.  Old implementation treats this directory name as errors.
This patch adds a guard like "[Uu]known[^-]".

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D114346
The file was modifiedopenmp/runtime/cmake/LibompCheckLinkerFlag.cmake
The file was modifiedopenmp/runtime/cmake/LibompCheckFortranFlag.cmake
Commit 41a681ce096d7abcf5cb867bd6ec06ac5e8d948f by wlei
[FS-AFDO][llvm-profgen] Generate profile with FS-AFDO discriminator

In order to support generating profile  with FS discriminator, three kind of changes are done in llvm-profgen:

1) Dissassemble .rodata section to check if FS discriminator var ('"__llvm_fs_discriminator__"') exists and set the corresponding flag in the binary.

2) Change the discriminator decoding in `getBaseDiscriminator` and `getDuplicationFactor`.

3) set true for `FunctionSamples::ProfileIsFS` to enable FS functionality in ProfileData.

Reviewed By: xur, hoy, wenlei

Differential Revision: https://reviews.llvm.org/D113296
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.cpp
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.cpp
The file was addedllvm/test/tools/llvm-profgen/Inputs/fs-discriminator.perfbin
The file was addedllvm/test/tools/llvm-profgen/Inputs/fs-discriminator.raw.prof
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.h
The file was addedllvm/test/tools/llvm-profgen/fs-discriminator.test
Commit b83a4222b1ab5f4ddab19d83995a43646af56bfe by leevince
[ObjectYAML/obj2yaml/yaml2obj][MachO] Support indirect symbol table

Tools such as `llvm-objdump` or `llvm-readobj` support indirect symbol
tables. Here, support it for `obj2yaml` and `yaml2obj`.

Reviewed By: jhenderson, drodriguez

Differential Revision: https://reviews.llvm.org/D114410
The file was modifiedllvm/lib/ObjectYAML/MachOYAML.cpp
The file was addedllvm/test/ObjectYAML/MachO/dsymtab.yaml
The file was modifiedllvm/lib/ObjectYAML/MachOEmitter.cpp
The file was modifiedllvm/include/llvm/ObjectYAML/MachOYAML.h
The file was modifiedllvm/tools/obj2yaml/macho2yaml.cpp
Commit f15a8545672a643f2a3e0a9ad7d1958470ee488d by wlei
[llvm-profgen] Truncate the context with zero probe ID

Due to the debug info merging, there may have some contexts with zero probe id, we should truncate the context to avoid misleading pre-inliner.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D114284
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.cpp
Commit 61e353e0b623cef98a8a98f1a9aca60c0142b1ad by ajcbik
[mlir][sparse] added sparse out element wise mult integration test

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D114822
The file was addedmlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_mult_elt.mlir
Commit 7c1d77798346ed49fe940c651668ee922f2976e9 by Vitaly Buka
[NFC][sanitizer] Add entry point for compression

Add Compression::Test type which just pretends packing,
but does nothing useful. It's only called from test for now.

Depends on D114493.

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D114494
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stack_store.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_stack_store_test.cpp
Commit 520f641877cd58d9cc911de36284b458a7be13fb by mtrofin
[test] Avoid dumping .o in source tree (expand-pseudos.ll)

Piping the input to llc avoids that (i.e. llc .... < %s vs llc ... %s)
The file was modifiedllvm/test/CodeGen/ARM/expand-pseudos.ll