clang: Store Triple in multiset (#189264)
Previously this was storing StringRefs, which just happen
to be constant allocated strings. Change this into an owning
reference in the form that will actually be used. This will allow
changing the triples to something computed without maintaining
a table of every possible permutation.
clang: Simplify OpenMP triple adjustment
Previously this would find a list of offloading triples,
then later fill in the unknown components specifically for
OpenMP after the fact. Start normalizing the triples upfront,
before inserting into the set. Also stop special casing OpenMP
since there's no apparent reason to treat it differently from
other offload languages.
Also operate on the Triple rather than the string, and handle
the unset OS and environment separately.
clang: Store Triple in multiset
Previously this was storing StringRefs, which just happen
to be constant allocated strings. Change this into an owning
reference in the form that will actually be used. This will allow
changing the triples to something computed without maintaining
a table of every possible permutation.
[clang-format] Fix spacing before :: after non-macro identifiers (#189024)
This narrows clang-format's spacing heuristic for `identifier ::`.
Previously, clang-format preserved existing whitespace before `::` after
any
identifier, which caused inputs like:
```c++
template <typename T>
auto mem = &T :: member;
```
to format as:
```c++
template <typename T>
auto mem = &T ::member;
```
[20 lines not shown]
[flang][OpenACC] Fix false DEFAULT(NONE) error for named DO loop construct names (#189204)
In OpenACC semantic checking filter out symbols with MiscDetails, which
include construct names, scope names, complex part designators, type
parameter inquiries, etc.
[Support] Remove Executor abstract base class from Parallel.cpp. NFC (#189266)
ThreadPoolExecutor is the only implementation. Remove the Executor
base class so that add() and getThreadCount() are direct calls
instead of virtual dispatches.
[VPlan] Use transferSuccessors in mergeBlocksIntoPredecessors (NFC). (#189275)
transferSuccessors is more compact and is guaranteed to preserve the
predecessor/successor order properly in all cases. This is not an issue
today, but will when used in more places, including #186252.
Split off from approved
https://github.com/llvm/llvm-project/pull/186252.
PR: https://github.com/llvm/llvm-project/pull/189275
[LLVM] remove redundant uses of dyn_cast (NFC) (#189105)
This removes dyn_cast invocations where the argument is already of the
target type (including through subtyping). This was created by adding a
static assert in dyn_cast and letting an LLM iterate until the code base
compiled. I then went through each example and cleaned it up. This does
not commit the static assert in dyn_cast, because it would prevent a lot
of uses in templated code. To prevent backsliding we should instead add
an LLVM aware version of
https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-casting.html
(or expand the existing one).
[msan] Add MSan instrumentation support for Hexagon (#189122)
Add MemorySanitizer instrumentation pass support for Hexagon Linux. This
is the codegen/instrumentation side; the compiler-rt runtime changes are
in a separate patch.
The shadow memory layout uses XOR-based mapping with XorMask=0x20000000
and OriginBase=0x50000000, designed to fit within the 32-bit address
space.
VarArg handling uses VarArgGenericHelper with VAListTagSize=12, matching
the Hexagon ABI where va_list is a three-pointer struct {
current_reg_area, reg_area_end, overflow_area }.
[compiler-rt][msan] Guard shmat interceptor w SANITIZER_INTERCEPT_SHMCTL (#189198)
The shmat interceptor calls REAL(shmctl), but shmctl is not intercepted
on all targets (e.g. 32-bit Linux with musl). Guard shmat behind
SANITIZER_INTERCEPT_SHMCTL and use a MSAN_MAYBE_INTERCEPT pattern
consistent with other conditional interceptors.
[compiler-rt][msan] Add MSan support for Hexagon (Linux) (#189124)
Add the runtime infrastructure for MemorySanitizer on Hexagon Linux.
Hexagon is 32-bit, so the shadow memory layout uses a compact XOR-based
mapping that fits within the lower 3GB of address space:
0x00000000 - 0x10000000 APP-1 (256MB, program text/data/heap)
0x10000000 - 0x20000000 ALLOCATOR (256MB)
0x20000000 - 0x40000000 SHADOW-1 (512MB, covers APP-1 + ALLOCATOR)
0x40000000 - 0x50000000 APP-2 (256MB, shared libs + stack)
0x60000000 - 0x70000000 SHADOW-2 (256MB, covers APP-2)
0x70000000 - 0x90000000 ORIGIN-1 (512MB)
0xB0000000 - 0xC0000000 ORIGIN-2 (256MB)
MEM_TO_SHADOW uses XOR 0x20000000, and SHADOW_TO_ORIGIN adds 0x50000000.
The dual-APP layout accommodates QEMU user-mode, which places shared
libraries and the stack at 0x40000000.
The allocator uses SizeClassAllocator32 with a 256MB region at
0x10000000, and kMaxAllowedMallocSize is set to 1GB consistent with
other 32-bit targets.
clang: Avoid intermediate DenseSet of triples (#189263)
This was computing a DenseSet<StringRef> of triples, but the
only use was to insert all the entries into a multiset. Just
use the multiset in the first place.
clang: Store Triple in multiset
Previously this was storing StringRefs, which just happen
to be constant allocated strings. Change this into an owning
reference in the form that will actually be used. This will allow
changing the triples to something computed without maintaining
a table of every possible permutation.
clang: Simplify OpenMP triple adjustment
Previously this would find a list of offloading triples,
then later fill in the unknown components specifically for
OpenMP after the fact. Start normalizing the triples upfront,
before inserting into the set. Also stop special casing OpenMP
since there's no apparent reason to treat it differently from
other offload languages.
Also operate on the Triple rather than the string, and handle
the unset OS and environment separately.
clang: Avoid intermediate DenseSet of triples
This was computing a DenseSet<StringRef> of triples, but the
only use was to insert all the entries into a multiset. Just
use the multiset in the first place.
[LV] Fix offset handling for epilogue resume values. (NFCI) (#189259)
Instead of replacing all uses of the canonical IV with an add of the
resume value and then relying on the fold to simplify, directly create
offset versions of both the canonical IV and its increment.
The original offset computation were incorrect, but not resulted in
mis-compiles due to the corresponding fold.
Split off from approved
https://github.com/llvm/llvm-project/pull/156262.
clang: Simplify OpenMP triple adjustment
Previously this would find a list of offloading triples,
then later fill in the unknown components specifically for
OpenMP after the fact. Start normalizing the triples upfront,
before inserting into the set. Also stop special casing OpenMP
since there's no apparent reason to treat it differently from
other offload languages.
Also operate on the Triple rather than the string, and handle
the unset OS and environment separately.