Changes

Summary

  1. sanitizer_common: split LibIgnore into fast/slow paths (details)
  2. sanitizer_common: sanitize time functions (details)
  3. [clang-repl] Implement partial translation units and error recovery. (details)
  4. sanitizer_common: add simpler ThreadRegistry ctor (details)
  5. [lldb] Fix compilation by adjusting to the new ASTContext signature. (details)
  6. sanitizer_common: unbreak ThreadRegistry tests (details)
  7. [IfCvt] Don't use pristine register for counting liveins for predicated instructions. (details)
  8. [Analysis] Remove unused declaration isPotentiallyReachableFromMany (NFC) (details)
  9. Revert "[clang-repl] Implement partial translation units and error recovery." (details)
  10. [ARM] Add lowering of uadd_sat to uq{add|sub}8 and uq{add|sub}16 (details)
  11. [lld/mac] Use normal Undefined machinery for dyld_stub_binder lookup (details)
  12. [DivRemPairs] Add an initial case for hoisting to a common predecessor. (details)
  13. [RISCV] Remove stale FIXME from a test. NFC (details)
  14. [lld/mac] Always reference dyld_stub_binder when linked with libSystem (details)
  15. [lld/mac] Unbreak objc.s after 6e05c1cd5f98 (details)
  16. [RISCV] Add tests for suboptimal handling of negative constants on the LHS of i32 shifts/rotates/subtracts on RV64. NFC (details)
  17. [RISCV] Add tests for suboptimal handling of negative constants for i32 uaddo/usubo on RV64. NFC (details)
  18. [VPlan] Remove default arg from getVPValue (NFC). (details)
  19. [lld-macho][nfc] Avoid using std::map for PlatformKinds (details)
  20. [lld-macho][nfc] Remove unnecessary llvm:: namespace prefixes (details)
  21. [lld-macho][nfc] clang-format (details)
  22. [IndVars] Don't widen pointers in WidenIV::getWideRecurrence (details)
  23. [Attributor][NFCI] Add UsedAssumedInformation to more interfaces (details)
  24. [OpenMP] Simplify variable sharing and increase shared memory size (details)
  25. [OpenMP] Create and use `__kmpc_is_generic_main_thread` (details)
  26. [lld-macho][nfc] Fix YAML input in compact-unwind-sym-relocs.s (details)
  27. [llvm][Inliner] Templatize PriorityInlineOrder (details)
  28. Support AArch64/Linux watchpoint on tagged addresses (details)
  29. [mlir] Fix broadcasting check with 1 values (details)
  30. [LLDB] Only build TestWatchTaggedAddress.py on aarch64 PAC targets (details)
  31. [AArch64] De-capitalize some Emit* functions (details)
  32. [llvm-exegesis] Fix compilation with old libpfm versions. (details)
  33. [analyzer][NFC] Display the correct function name even in crash dumps (details)
Commit 1e1f7520279c93a59fa6511028ff40412065985e by dvyukov
sanitizer_common: split LibIgnore into fast/slow paths

LibIgnore is checked in every interceptor.
Currently it has all logic in the single function
in the header, which makes it uninlinable.
Split it into fast path (no libraries ignored)
and slow path (have ignored libraries).
It makes the fast path inlinable (single load).

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D105719
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_libignore.h
Commit 8df3c7ded26fb9ee1ecf5a5099da7645174a2e26 by dvyukov
sanitizer_common: sanitize time functions

We have SleepForSeconds, SleepForMillis and internal_sleep.
Some are implemented in terms of libc functions, some -- in terms
of syscalls. Some are implemented in per OS files,
some -- in libc/nolibc files. That's unnecessary complex
and libc functions cause crashes in some contexts because
we intercept them. There is no single reason to have calls to libc
when we have syscalls (and we have them anyway).

Add internal_usleep that is implemented in terms of syscalls per OS.
Make SleepForSeconds/SleepForMillis/internal_sleep a wrapper
around internal_usleep that is implemented in sanitizer_common.cpp once.

Also remove return values for internal_sleep, it's not used anywhere.

Eventually it would be nice to remove SleepForSeconds/SleepForMillis/internal_sleep.
There is no point in having that many different names for the same thing.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D105718
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_win.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_libc.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common.h
Commit 6775fc6ffa3ca1c36b20c25fa4e7f48f81213cf2 by v.g.vassilev
[clang-repl] Implement partial translation units and error recovery.

https://reviews.llvm.org/D96033 contained a discussion regarding efficient
modeling of error recovery. @rjmccall has outlined the key ideas:

Conceptually, we can split the translation unit into a sequence of partial
translation units (PTUs). Every declaration will be associated with a unique PTU
that owns it.

The first key insight here is that the owning PTU isn't always the "active"
(most recent) PTU, and it isn't always the PTU that the declaration
"comes from". A new declaration (that isn't a redeclaration or specialization of
anything) does belong to the active PTU. A template specialization, however,
belongs to the most recent PTU of all the declarations in its signature - mostly
that means that it can be pulled into a more recent PTU by its template
arguments.

The second key insight is that processing a PTU might extend an earlier PTU.
Rolling back the later PTU shouldn't throw that extension away. For example, if
the second PTU defines a template, and the third PTU requires that template to
be instantiated at float, that template specialization is still part of the
second PTU. Similarly, if the fifth PTU uses an inline function belonging to the
fourth, that definition still belongs to the fourth. When we go to emit code in
a new PTU, we map each declaration we have to emit back to its owning PTU and
emit it in a new module for just the extensions to that PTU. We keep track of
all the modules we've emitted for a PTU so that we can unload them all if we
decide to roll it back.

Most declarations/definitions will only refer to entities from the same or
earlier PTUs. However, it is possible (primarily by defining a
previously-declared entity, but also through templates or ADL) for an entity
that belongs to one PTU to refer to something from a later PTU. We will have to
keep track of this and prevent unwinding to later PTU when we recognize it.
Fortunately, this should be very rare; and crucially, we don't have to do the
bookkeeping for this if we've only got one PTU, e.g. in normal compilation.
Otherwise, PTUs after the first just need to record enough metadata to be able
to revert any changes they've made to declarations belonging to earlier PTUs,
e.g. to redeclaration chains or template specialization lists.

It should even eventually be possible for PTUs to provide their own slab
allocators which can be thrown away as part of rolling back the PTU. We can
maintain a notion of the active allocator and allocate things like Stmt/Expr
nodes in it, temporarily changing it to the appropriate PTU whenever we go to do
something like instantiate a function template. More care will be required when
allocating declarations and types, though.

We would want the PTU to be efficiently recoverable from a Decl; I'm not sure
how best to do that. An easy option that would cover most declarations would be
to make multiple TranslationUnitDecls and parent the declarations appropriately,
but I don't think that's good enough for things like member function templates,
since an instantiation of that would still be parented by its original class.
Maybe we can work this into the DC chain somehow, like how lexical DCs are.

We add a different kind of translation unit `TU_Incremental` which is a
complete translation unit that we might nonetheless incrementally extend later.
Because it is complete (and we might want to generate code for it), we do
perform template instantiation, but because it might be extended later, we don't
warn if it declares or uses undefined internal-linkage symbols.

This patch teaches clang-repl how to recover from errors by disconnecting the
most recent PTU and update the primary PTU lookup tables. For instance:

```./clang-repl
clang-repl> int i = 12; error;
In file included from <<< inputs >>>:1:
input_line_0:1:13: error: C++ requires a type specifier for all declarations
int i = 12; error;
            ^
error: Parsing failed.
clang-repl> int i = 13; extern "C" int printf(const char*,...);
clang-repl> auto r1 = printf("i=%d\n", i);
i=13
clang-repl> quit
```

Differential revision: https://reviews.llvm.org/D104918
The file was modifiedclang/lib/Frontend/ASTUnit.cpp
The file was modifiedclang/tools/clang-import-test/clang-import-test.cpp
The file was modifiedclang/lib/AST/DeclBase.cpp
The file was modifiedclang/lib/Frontend/CompilerInstance.cpp
The file was modifiedclang/include/clang/AST/Decl.h
The file was modifiedclang/unittests/Interpreter/InterpreterTest.cpp
The file was modifiedclang/unittests/Interpreter/IncrementalProcessingTest.cpp
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was modifiedclang/include/clang/AST/ASTContext.h
The file was modifiedclang/include/clang/AST/Redeclarable.h
The file was modifiedclang/lib/Interpreter/IncrementalParser.cpp
The file was modifiedclang/include/clang/Interpreter/Interpreter.h
The file was modifiedclang/lib/Interpreter/Interpreter.cpp
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/include/clang/Basic/LangOptions.h
The file was modifiedclang/lib/Interpreter/IncrementalParser.h
The file was modifiedclang/unittests/Lex/PPCallbacksTest.cpp
The file was addedclang/include/clang/Interpreter/PartialTranslationUnit.h
The file was modifiedclang/lib/AST/Decl.cpp
The file was removedclang/include/clang/Interpreter/Transaction.h
The file was modifiedclang/unittests/AST/ASTVectorTest.cpp
The file was modifiedclang/include/clang/Lex/Preprocessor.h
Commit 8e489b4b96e31cfb004e03cfa1393c425c504013 by dvyukov
sanitizer_common: add simpler ThreadRegistry ctor

Currently ThreadRegistry is overcomplicated because of tsan,
it needs tid quarantine and reuse counters. Other sanitizers
don't need that. It also seems that no other sanitizer now
needs max number of threads. Asan used to need 2^24 limit,
but it does not seem to be needed now. Other sanitizers blindly
copy-pasted that without reasons. Lsan also uses quarantine,
but I don't see why that may be potentially needed.

Add a ThreadRegistry ctor that does not require any sizes
and use it in all sanitizers except for tsan.
In preparation for new tsan runtime, which won't need
any of these parameters as well.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D105713
The file was modifiedcompiler-rt/lib/asan/asan_thread.h
The file was modifiedcompiler-rt/lib/lsan/lsan_thread.cpp
The file was modifiedcompiler-rt/lib/memprof/memprof_thread.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h
The file was modifiedcompiler-rt/lib/asan/asan_thread.cpp
The file was modifiedcompiler-rt/lib/memprof/memprof_thread.h
Commit 03a3f86071c10a1f6cbbf7375aa6fe9d94168972 by v.g.vassilev
[lldb] Fix compilation by adjusting to the new ASTContext signature.

This change was introduced in https://reviews.llvm.org/D104918
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
Commit 6062c672bc5e560a4c3dc73741f9e82b39d08527 by dvyukov
sanitizer_common: unbreak ThreadRegistry tests

https://reviews.llvm.org/D105713
forgot to update tests for the new ctor.

Differential Revision: https://reviews.llvm.org/D105772
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cpp
Commit dc0bbc9d891ab20850761d8d75acc6676754ce2d by david.green
[IfCvt] Don't use pristine register for counting liveins for predicated instructions.

The test case here hits machine verifier problems. There are volatile
long loads that the results of do not get used, loading into two dead
registers. IfCvt will predicate them and as it does will add implicit
uses of the predicating registers due to thinking they are live in. As
nothing has used the register, the machine verifier disagrees that they
are really live and we end up with a failure.

The registers come from Pristine regs that LivePhysRegs counts as live.
This patch adds a addLiveInsNoPristines method to be used instead in
IfCvt, so that only really live in regs need to be added as implicit
operands.

Differential Revision: https://reviews.llvm.org/D90965
The file was addedllvm/test/CodeGen/ARM/ldrd_ifcvt.ll
The file was modifiedllvm/include/llvm/CodeGen/LivePhysRegs.h
The file was modifiedllvm/lib/CodeGen/LivePhysRegs.cpp
The file was modifiedllvm/lib/CodeGen/IfConversion.cpp
Commit ee8da6369225f47f85e61e1ef2807af6a8677a0d by kazu
[Analysis] Remove unused declaration isPotentiallyReachableFromMany (NFC)
The file was modifiedllvm/include/llvm/Analysis/CFG.h
Commit 5922f234c8c95f61534160a31db15dfc10da9b60 by v.g.vassilev
Revert "[clang-repl] Implement partial translation units and error recovery."

This reverts commit 6775fc6ffa3ca1c36b20c25fa4e7f48f81213cf2.

It also reverts "[lldb] Fix compilation by adjusting to the new ASTContext signature."

This reverts commit 03a3f86071c10a1f6cbbf7375aa6fe9d94168972.

We see some failures on the lldb infrastructure, these changes might play a role
in it. Let's revert it now and see if the bots will become green.

Ref: https://reviews.llvm.org/D104918
The file was modifiedclang/tools/clang-import-test/clang-import-test.cpp
The file was modifiedclang/include/clang/Lex/Preprocessor.h
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.h
The file was modifiedclang/include/clang/AST/Redeclarable.h
The file was modifiedclang/lib/Interpreter/IncrementalParser.cpp
The file was addedclang/include/clang/Interpreter/Transaction.h
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Frontend/CompilerInstance.cpp
The file was modifiedclang/unittests/Interpreter/InterpreterTest.cpp
The file was modifiedclang/lib/Interpreter/IncrementalParser.h
The file was removedclang/include/clang/Interpreter/PartialTranslationUnit.h
The file was modifiedclang/lib/AST/Decl.cpp
The file was modifiedclang/lib/Interpreter/Interpreter.cpp
The file was modifiedclang/unittests/AST/ASTVectorTest.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was modifiedclang/unittests/Lex/PPCallbacksTest.cpp
The file was modifiedclang/lib/AST/DeclBase.cpp
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/lib/Frontend/ASTUnit.cpp
The file was modifiedclang/unittests/Interpreter/IncrementalProcessingTest.cpp
The file was modifiedclang/include/clang/AST/ASTContext.h
The file was modifiedclang/include/clang/AST/Decl.h
The file was modifiedclang/include/clang/Interpreter/Interpreter.h
Commit 98c2e4115d8d7d4962df52f595e8d2d0cfdfdc8f by david.green
[ARM] Add lowering of uadd_sat to uq{add|sub}8 and uq{add|sub}16

This follow the lead of https://reviews.llvm.org/D68974 to add lowering
of unsigned saturated addition/subtraction.

Differential Revision: https://reviews.llvm.org/D105413
The file was modifiedllvm/test/CodeGen/ARM/uadd_sat_plus.ll
The file was modifiedllvm/test/CodeGen/ARM/uadd_sat.ll
The file was modifiedllvm/test/CodeGen/ARM/usub_sat.ll
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.h
The file was modifiedllvm/lib/Target/ARM/ARMInstrInfo.td
The file was modifiedllvm/lib/Target/ARM/ARMInstrThumb2.td
The file was modifiedllvm/test/CodeGen/ARM/usub_sat_plus.ll
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
Commit 10e28a748493270e31821acc0f7f0e1a9a9b0735 by thakis
[lld/mac] Use normal Undefined machinery for dyld_stub_binder lookup

This is for aesthetic reasons, I'm not aware of anything that needs
this in practice. It does have a few effects:

- `-undefined dynamic_lookup` now has an effect for dyld_stub_binder.
  This matches ld64.

- `-U dyld_stub_binder` now works like you'd expect (it doesn't work in ld64).

- The error message for a missing dyld_stub_binder symbol now looks like
  other undefined reference symbols, it changes from

      symbol dyld_stub_binder not found (normally in libSystem.dylib). Needed to perform lazy binding.

  to

      error: undefined symbol: dyld_stub_binder
      >>> referenced by lazy binding (normally in libSystem.dylib)

Also add test coverage for that error message.

But in practice, this should have no interesting effects since everything links
in dyld_stub_binder via libSystem anyways.

Differential Revision: https://reviews.llvm.org/D105781
The file was addedlld/test/MachO/dyld-stub-binder.s
The file was modifiedlld/MachO/SyntheticSections.cpp
Commit e38b7e894808ec2a0c976ab01e44364f167508d3 by craig.topper
[DivRemPairs] Add an initial case for hoisting to a common predecessor.

This patch adds support for hoisting the division and maybe the
remainder for control flow graphs like this.

```
PredBB
  |  \
  |  Rem
  |  /
Div
```

If we have DivRem we'll hoist both to PredBB. If not we'll just
hoist Div and expand Rem using the Div.

This improves our codegen for something like this

```
__uint128_t udivmodti4(__uint128_t dividend, __uint128_t divisor, __uint128_t *remainder) {
    if (remainder != 0)
        *remainder = dividend % divisor;
    return dividend / divisor;
}
```

Reviewed By: spatel, lebedev.ri

Differential Revision: https://reviews.llvm.org/D87555
The file was modifiedllvm/test/Transforms/DivRemPairs/X86/div-expanded-rem-pair.ll
The file was modifiedllvm/lib/Transforms/Scalar/DivRemPairs.cpp
Commit 1410aab62231847b5c5bdbf41a73106f51449932 by craig.topper
[RISCV] Remove stale FIXME from a test. NFC

sext has been used for sltu/sltiu since e0e62e97.
The file was modifiedllvm/test/CodeGen/RISCV/alu32.ll
Commit 6e05c1cd5f98350520147d932efc853f2638ce25 by thakis
[lld/mac] Always reference dyld_stub_binder when linked with libSystem

lld currently only references dyld_stub_binder when it's needed.
ld64 always references it when libSystem is linked.
Match ld64.

The (somewhat lame) motivation is that `nm` on a binary without any
export writes a "no symbols" warning to stderr, and this change makes
it so that every binary in practice has at least a reference to
dyld_stub_binder, which suppresses that.

Every "real" output file will reference dyld_stub_binder, so most
of the time this shouldn't make much of a difference. And if you
really don't want to have this reference for whatever reason, you
can stop passing -lSystem, like you have to for ld64 anyways.

(After linking any dylib, we dump the exported list of symbols to
a txt file with `nm` and only relink downstream deps if that txt
file changes. A nicer fix is to make lld optionally write .tbd files
with the public interface of a linked dylib and use that instead,
but for now the txt files are what we do.)

Differential Revision: https://reviews.llvm.org/D105782
The file was modifiedlld/test/MachO/stabs.s
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/test/MachO/lto-internalize.ll
The file was modifiedlld/test/MachO/dyld-stub-binder.s
Commit c10947b5f808af312e9f904096ae1dbaf95ad9f6 by thakis
[lld/mac] Unbreak objc.s after 6e05c1cd5f98
The file was modifiedlld/test/MachO/objc.s
Commit 6644a611213c7457574bc24b7098ae04753c49ae by craig.topper
[RISCV] Add tests for suboptimal handling of negative constants on the LHS of i32 shifts/rotates/subtracts on RV64. NFC

The constants end up getting zero extended to i64, but sign extend
would be better for constant materialization. We're using W
instructions so either behavior is correct since the upper bits
aren't read.
The file was modifiedllvm/test/CodeGen/RISCV/alu32.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv64zbb-zbp.ll
Commit f0393deb336737b9ab9112089ea29866dd20da03 by craig.topper
[RISCV] Add tests for suboptimal handling of negative constants for i32 uaddo/usubo on RV64. NFC

We end up zero extending constants when we promote to i64. We
should sign extend instead to allow use of addiw or improve
constant materialization.
The file was modifiedllvm/test/CodeGen/RISCV/xaluo.ll
Commit c6e4c1fbd80e60be3a819b22d6b647551f704191 by flo
[VPlan] Remove default arg from getVPValue (NFC).

The const version of VPValue::getVPValue still had a default value for
the value index. Remove the default value and use getVPSingleValue
instead, which is the proper function.
The file was modifiedllvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/VPlanValue.h
Commit f6e84a84f95eb505e0dabcb8a16fcf77738a3c97 by jezng
[lld-macho][nfc] Avoid using std::map for PlatformKinds

The mappings we were using had a small number of keys, so a vector is
probably better. This allows us to remove the last usage of std::map in
our codebase.

I also used `removeSimulator` to simplify the code a bit further.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D105786
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/Driver.h
The file was modifiedlld/MachO/InputFiles.cpp
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/InputFiles.h
Commit 28a2102ee377a8bbcf3656fae87a74fd50101aa4 by jezng
[lld-macho][nfc] Remove unnecessary llvm:: namespace prefixes
The file was modifiedlld/MachO/UnwindInfoSection.cpp
The file was modifiedlld/MachO/DriverUtils.cpp
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/Writer.cpp
Commit 11a0d236503b9ed53a3b216181344a55a0212f95 by jezng
[lld-macho][nfc] clang-format
The file was modifiedlld/MachO/InputFiles.h
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/InputFiles.cpp
Commit 6144085c29b31e8e43122920a5bfba3d7b77e7ae by efriedma
[IndVars] Don't widen pointers in WidenIV::getWideRecurrence

It's not a reasonable transform, and calling getSignExtendExpr() on a
pointer hits an assertion.
The file was modifiedllvm/test/Transforms/IndVarSimplify/signed-trip-count.ll
The file was modifiedllvm/lib/Transforms/Utils/SimplifyIndVar.cpp
Commit 792aac98973daf573a288ae0cbdc9e2633f599e5 by johannes
[Attributor][NFCI] Add UsedAssumedInformation to more interfaces

As with other Attributor interfaces we often want to know if assumed
information was used to answer a query. This is important if only
known information is allowed or if known information can lead to an
early fixpoint. The users have been adjusted but none of them utilizes
the new information yet.
The file was modifiedllvm/lib/Transforms/IPO/Attributor.cpp
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
Commit 1ab1f04a2be34bea2fb34df0f5ff0bd75bdc7aa0 by johannes
[OpenMP] Simplify variable sharing and increase shared memory size

In order to avoid malloc/free, up to NUM_SHARED_VARIABLES_IN_SHARED_MEM
(=64) variables are communicated in dedicated shared memory instead. The
simplification does avoid the need for an "init" and requires "deinit"
only if we ever communicate more than NUM_SHARED_VARIABLES_IN_SHARED_MEM
variables.

Differential Revision: https://reviews.llvm.org/D105767
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/omptarget.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/omptarget.h
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/omp_data.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/data_sharing.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
Commit a7b7b5dfe5a931a76cbe8410e5a9f55beea73c8e by johannes
[OpenMP] Create and use `__kmpc_is_generic_main_thread`

In order to fold calls based on high-level knowledge and control flow
tracking it helps to expose the information as a runtime call. The
logic: `!SPMD && getTID() == getMasterTID()` was used in various places
and is now encapsulated in `__kmpc_is_generic_main_thread`. As part of
this rewrite we replaced eager computation of arguments with on-demand
computation, especially helpful if the calls can be folded and arguments
don't need to be computed consequently.

Differential Revision: https://reviews.llvm.org/D105768
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/parallel.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/support.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/support.h
The file was modifiedopenmp/libomptarget/deviceRTLs/interface.h
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/omptarget.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/omptargeti.h
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/data_sharing.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/reduction.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/task.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/sync.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/loop.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/libcall.cu
Commit 0fb299072c5b26396ab84002445570f296be44b3 by jezng
[lld-macho][nfc] Fix YAML input in compact-unwind-sym-relocs.s

* Adjust strsize so llvm-objdump doesn't complain about it extending
  past the end of file
* Remove symbol that was referencing a deleted section
* Adjust n_sect of the remaining `_main` symbol to point at the right
  section
The file was modifiedlld/test/MachO/compact-unwind-sym-relocs.s
Commit 6ebeb7f8baf3feb6657c4e9c523fe61eca2dc43d by taolq
[llvm][Inliner] Templatize PriorityInlineOrder

The patch templatize PriorityInlinerOrder so that it can accept any type priority metric.

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D104972
The file was modifiedllvm/lib/Transforms/IPO/Inliner.cpp
Commit 5e6aabd48e351cf2632c25cb8bdfd0598a5019a6 by omair.javaid
Support AArch64/Linux watchpoint on tagged addresses

AArch64 architecture support virtual addresses with some of the top bits ignored.
These ignored bits can host memory tags or bit masks that can serve to check for
authentication of address integrity. We need to clear away the top ignored bits
from watchpoint address to reliably hit and set watchpoints on addresses
containing tags or masks in their top bits.

This patch adds support to watch tagged addresses on AArch64/Linux.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D101361
The file was modifiedlldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
The file was modifiedlldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h
The file was modifiedlldb/source/Target/Target.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
The file was addedlldb/test/API/commands/watchpoints/watch_tagged_addr/TestWatchTaggedAddress.py
The file was modifiedlldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp
The file was addedlldb/test/API/commands/watchpoints/watch_tagged_addr/main.c
The file was addedlldb/test/API/commands/watchpoints/watch_tagged_addr/Makefile
Commit 51cbe4e58797d85c0f17d4a9cad1bcb11743afae by jpienaar
[mlir] Fix broadcasting check with 1 values

The trait was inconsistent with the other broadcasting logic here. And
also fix printing here to use ? rather than -1 in the error.

Differential Revision: https://reviews.llvm.org/D105748
The file was modifiedmlir/lib/Dialect/Traits.cpp
The file was modifiedmlir/test/Dialect/traits.mlir
Commit 7c7447e3443557f9cc98389682c3f55dd7abb570 by omair.javaid
[LLDB] Only build TestWatchTaggedAddress.py on aarch64 PAC targets

This patch fixes buildbot failures caused by TestWatchTaggedAddress.py

Differential Revision: https://reviews.llvm.org/D101361
The file was modifiedlldb/test/API/commands/watchpoints/watch_tagged_addr/TestWatchTaggedAddress.py
Commit 57503524b18009019779d731f186cff33a34ab1a by i
[AArch64] De-capitalize some Emit* functions

AsmParser/AsmPrinter/Streamer are mostly consistent on emit* functions now.
The file was modifiedllvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
The file was modifiedllvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
Commit 04f8ffd98306a0b0b60987208547ee6745b0fc3e by courbet
[llvm-exegesis] Fix compilation with old libpfm versions.

Do not try include `perfmon/perf_event.h` when we are not sure that it
exists.

Fixes PR51017.

Differential Revision: https://reviews.llvm.org/D105615
The file was modifiedllvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp
Commit d3e14fafc69a07e3dab9ddb91f1d810bb5f8d7a0 by balazs.benics
[analyzer][NFC] Display the correct function name even in crash dumps

The `-analyzer-display-progress` displayed the function name of the
currently analyzed function. It differs in C and C++. In C++, it
prints the argument types as well in a comma-separated list.
While in C, only the function name is displayed, without the brackets.
E.g.:

  C++: foo(), foo(int, float)
  C:   foo

In crash traces, the analyzer dumps the location contexts, but the
string is not enough for `-analyze-function` in C++ mode.
This patch addresses the issue by dumping the proper function names
even in stack traces.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D105708
The file was modifiedclang/test/Analysis/crash-trace.c
The file was modifiedclang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
The file was modifiedclang/include/clang/Analysis/AnalysisDeclContext.h
The file was modifiedclang/lib/Analysis/AnalysisDeclContext.cpp