LLVM/project ab885fdclang/include/clang/Driver ToolChain.h, clang/lib/Driver Driver.cpp

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.
DeltaFile
+20-16clang/lib/Driver/Driver.cpp
+7-0llvm/include/llvm/TargetParser/Triple.h
+4-0clang/include/clang/Driver/ToolChain.h
+31-163 files

LLVM/project fb3e120llvm/test/CodeGen/AMDGPU swizzle.bit.extract.ll asyncmark-max-pregfx12.ll

AMDGPU: Avoid using -march in tests
DeltaFile
+4-4llvm/test/CodeGen/AMDGPU/swizzle.bit.extract.ll
+3-3llvm/test/CodeGen/AMDGPU/asyncmark-max-pregfx12.ll
+3-3llvm/test/CodeGen/AMDGPU/spillv16.mir
+3-3llvm/test/CodeGen/AMDGPU/mixed-vmem-types.ll
+2-2llvm/test/CodeGen/AMDGPU/asyncmark-pregfx12.ll
+2-2llvm/test/CodeGen/AMDGPU/fneg-fabs.ll
+17-1724 files not shown
+47-4730 files

LLVM/project 028d64ellvm/test/CodeGen/AMDGPU swizzle.bit.extract.ll spillv16.mir

AMDGPU: Avoid using -march in tests
DeltaFile
+4-4llvm/test/CodeGen/AMDGPU/swizzle.bit.extract.ll
+3-3llvm/test/CodeGen/AMDGPU/spillv16.mir
+3-3llvm/test/CodeGen/AMDGPU/mixed-vmem-types.ll
+3-3llvm/test/CodeGen/AMDGPU/asyncmark-max-pregfx12.ll
+2-2llvm/test/CodeGen/AMDGPU/spill_kill_v16.mir
+2-2llvm/test/CodeGen/AMDGPU/load-store-cnt.ll
+17-1723 files not shown
+46-4629 files

LLVM/project 2cd67b8clang/unittests/Format TokenAnnotatorTest.cpp

[clang-format][NFC] Adapt test data

To the fixed issue.

This amends 3f42ec658f2f08d8ce11909603c8a82dc9e1045a.
DeltaFile
+5-5clang/unittests/Format/TokenAnnotatorTest.cpp
+5-51 files

LLVM/project 2716f10llvm/test/CodeGen/AMDGPU swizzle.bit.extract.ll spillv16.mir

AMDGPU: Avoid using -march in tests
DeltaFile
+4-4llvm/test/CodeGen/AMDGPU/swizzle.bit.extract.ll
+3-3llvm/test/CodeGen/AMDGPU/spillv16.mir
+3-3llvm/test/CodeGen/AMDGPU/mixed-vmem-types.ll
+3-3llvm/test/CodeGen/AMDGPU/asyncmark-max-pregfx12.ll
+2-2llvm/test/CodeGen/AMDGPU/fabs.ll
+2-2llvm/test/CodeGen/AMDGPU/asyncmark-pregfx12.ll
+17-1722 files not shown
+45-4528 files

LLVM/project 51842c0clang/include/clang/Driver ToolChain.h, clang/lib/Driver Driver.cpp ToolChain.cpp

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.
DeltaFile
+19-13clang/include/clang/Driver/ToolChain.h
+9-10clang/lib/Driver/Driver.cpp
+1-1clang/lib/Driver/ToolChains/Clang.cpp
+1-1clang/lib/Driver/ToolChain.cpp
+30-254 files

LLVM/project d65b8fbclang/include/clang/Driver ToolChain.h, clang/lib/Driver Driver.cpp

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.
DeltaFile
+20-16clang/lib/Driver/Driver.cpp
+7-0llvm/include/llvm/TargetParser/Triple.h
+4-0clang/include/clang/Driver/ToolChain.h
+31-163 files

LLVM/project b579c5bclang/lib/Format QualifierAlignmentFixer.cpp FormatToken.h, clang/unittests/Format QualifierFixerTest.cpp FormatTest.cpp

[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]
DeltaFile
+2-27clang/lib/Format/QualifierAlignmentFixer.cpp
+27-0clang/lib/Format/FormatToken.h
+6-6clang/unittests/Format/QualifierFixerTest.cpp
+3-4clang/lib/Format/TokenAnnotator.cpp
+0-3clang/lib/Format/QualifierAlignmentFixer.h
+2-0clang/unittests/Format/FormatTest.cpp
+40-406 files

LLVM/project 5fa087fclang/lib/Format UnwrappedLineFormatter.cpp, clang/unittests/Format FormatTest.cpp

[clang-format] Don't merge short records with directly created objects (#189200)

It did merge the wrong brace.

Fixes #189155
DeltaFile
+6-0clang/unittests/Format/FormatTest.cpp
+3-1clang/lib/Format/UnwrappedLineFormatter.cpp
+9-12 files

LLVM/project cb017fdflang/lib/Semantics resolve-directives.cpp, flang/test/Semantics/OpenACC acc-parallel.f90

[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.
DeltaFile
+7-0flang/test/Semantics/OpenACC/acc-parallel.f90
+1-1flang/lib/Semantics/resolve-directives.cpp
+8-12 files

LLVM/project 5b1be75llvm/lib/Support Parallel.cpp

[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.
DeltaFile
+9-20llvm/lib/Support/Parallel.cpp
+9-201 files

LLVM/project b5d43f7llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

[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
DeltaFile
+1-4llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-41 files

LLVM/project 9a17aa4llvm/tools/llvm-objdump llvm-objdump.cpp

llvm-objdump: Avoid contraction in error message (#189272)
DeltaFile
+1-1llvm/tools/llvm-objdump/llvm-objdump.cpp
+1-11 files

LLVM/project 2c41a8dllvm/test/CodeGen/AMDGPU llvm.amdgcn.ds.bvh.stack.push.pop.rtn.ll llvm.amdgcn.dual_intersect_ray.ll

AMDGPU: Fix using -march in a couple tests (#189271)
DeltaFile
+2-2llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bvh.stack.push.pop.rtn.ll
+2-2llvm/test/CodeGen/AMDGPU/llvm.amdgcn.dual_intersect_ray.ll
+4-42 files

LLVM/project e911910llvm/lib/Analysis ValueTracking.cpp, llvm/lib/Target/ARM/AsmParser ARMAsmParser.cpp

[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).
DeltaFile
+46-49llvm/tools/llvm-size/llvm-size.cpp
+7-20llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+10-10llvm/lib/Transforms/IPO/GlobalOpt.cpp
+6-8llvm/lib/Transforms/IPO/GlobalDCE.cpp
+6-8llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
+3-5llvm/lib/Analysis/ValueTracking.cpp
+78-10017 files not shown
+105-14423 files

LLVM/project c8c3694llvm/tools/llvm-objdump llvm-objdump.cpp

llvm-objdump: Avoid contraction in error message
DeltaFile
+1-1llvm/tools/llvm-objdump/llvm-objdump.cpp
+1-11 files

LLVM/project 479a826llvm/lib/Support Parallel.cpp

[Support] Use namespace qualifiers in Parallel.cpp. NFC (#189268)

Replace `namespace llvm { namespace parallel { ... } }` blocks with
`using namespace` and qualified definitions per

https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-define-previously-declared-symbols

Also reformat the TaskGroup constructor to avoid clang-format issues
with #if/#endif split across the initializer list.
DeltaFile
+18-21llvm/lib/Support/Parallel.cpp
+18-211 files

LLVM/project ff13b76llvm/test/CodeGen/AMDGPU llvm.amdgcn.ds.bvh.stack.push.pop.rtn.ll llvm.amdgcn.dual_intersect_ray.ll

AMDGPU: Fix using -march in a couple tests
DeltaFile
+2-2llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bvh.stack.push.pop.rtn.ll
+2-2llvm/test/CodeGen/AMDGPU/llvm.amdgcn.dual_intersect_ray.ll
+4-42 files

LLVM/project 3fcbba3clang/lib/CIR/Dialect/Transforms LoweringPrepare.cpp

unreachable on RDC compilation
DeltaFile
+2-1clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+2-11 files

LLVM/project e17c219llvm/lib/Transforms/Instrumentation MemorySanitizer.cpp, llvm/test/Instrumentation/MemorySanitizer/Hexagon vararg-hexagon.ll hexagon.ll

[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 }.
DeltaFile
+90-0llvm/test/Instrumentation/MemorySanitizer/Hexagon/vararg-hexagon.ll
+86-0llvm/test/Instrumentation/MemorySanitizer/Hexagon/hexagon.ll
+20-0llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+196-03 files

LLVM/project a8cdc5acompiler-rt/lib/msan msan_interceptors.cpp, compiler-rt/lib/sanitizer_common sanitizer_platform_interceptors.h

[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.
DeltaFile
+6-1compiler-rt/lib/msan/msan_interceptors.cpp
+2-0compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+8-12 files

LLVM/project 44f1fa9compiler-rt/cmake/Modules AllSupportedArchDefs.cmake, compiler-rt/lib/msan msan.h msan_allocator.cpp

[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.
DeltaFile
+24-0compiler-rt/lib/msan/msan.h
+14-0compiler-rt/lib/msan/msan_allocator.cpp
+1-1compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+39-13 files

LLVM/project b8d0411clang/lib/Driver Driver.cpp

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.
DeltaFile
+8-10clang/lib/Driver/Driver.cpp
+8-101 files

LLVM/project 3fe1fd1clang/include/clang/Driver ToolChain.h, clang/lib/Driver Driver.cpp

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.
DeltaFile
+20-16clang/lib/Driver/Driver.cpp
+7-0llvm/include/llvm/TargetParser/Triple.h
+4-0clang/include/clang/Driver/ToolChain.h
+31-163 files

LLVM/project 23ddaccclang/include/clang/Driver ToolChain.h, clang/lib/Driver Driver.cpp ToolChain.cpp

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.
DeltaFile
+19-13clang/include/clang/Driver/ToolChain.h
+9-10clang/lib/Driver/Driver.cpp
+1-1clang/lib/Driver/ToolChains/Clang.cpp
+1-1clang/lib/Driver/ToolChain.cpp
+30-254 files

LLVM/project a58579eclang/lib/Driver Driver.cpp

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.
DeltaFile
+8-10clang/lib/Driver/Driver.cpp
+8-101 files

LLVM/project ad1e30bclang/include/clang/Basic OffloadArch.h, clang/lib/Basic OffloadArch.cpp

clang: Move Triple computing logic to separate function (#189262)
DeltaFile
+7-12clang/lib/Driver/Driver.cpp
+16-0clang/lib/Basic/OffloadArch.cpp
+4-0clang/include/clang/Basic/OffloadArch.h
+27-123 files

LLVM/project c467d38llvm/lib/Transforms/Vectorize VPlanTransforms.cpp LoopVectorize.cpp

[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.
DeltaFile
+28-11llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+15-8llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+43-192 files

LLVM/project 8374475clang/lib/Driver Driver.cpp

clang: Use isAMDGPU triple helper (#189261)

Also remove redundant SPIRV check.
DeltaFile
+1-1clang/lib/Driver/Driver.cpp
+1-11 files

LLVM/project cd9a653clang/include/clang/Driver ToolChain.h, clang/lib/Driver Driver.cpp ToolChain.cpp

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.
DeltaFile
+19-13clang/include/clang/Driver/ToolChain.h
+9-10clang/lib/Driver/Driver.cpp
+1-1clang/lib/Driver/ToolChain.cpp
+1-1clang/lib/Driver/ToolChains/Clang.cpp
+30-254 files