LLVM/project bc64e26clang/lib/Basic/Targets AArch64.cpp ARM.cpp, clang/test/Frontend gnu-mcount.c

clang/ARM: Derive -pg mcount name from the triple environment

For a glibc/gnueabi ARM and AArch64 targets, GCC's -pg instrumentation
always calls __gnu_mcount_nc (with the caller pushing LR, per the "nc"
no-LR-clobber ABI). clang only produced this when -meabi=gnu was passed
explicitly; a separate gnueabi triple wrongly called plain "mcount".

On ARM, glibc's EABI profiling entry point is __gnu_mcount_nc
(sysdeps/arm/arm-mcount.S, exported since GLIBC_2.8). It does provide plain
mcount/_mcount, but only as a legacy APCS compat alias (__mcount_arm_compat,
gated on GCC_COMPAT(4,3)/SHLIB_COMPAT) that reads an APCS frame-pointer
record rather than following the EABI push-LR convention. Calling it from
EABI -pg code is thus an ABI mismatch, not the intended entry point.

Derive the GNU-vs-plain mcount name from the triple environment in addition
to the explicit -meabi=gnu, so a gnueabi target gets the correct __gnu_mcount_nc
call by default, matching GCC:

    push    {lr}

    [5 lines not shown]
DeltaFile
+6-3clang/test/Frontend/gnu-mcount.c
+4-3clang/lib/Basic/Targets/ARM.cpp
+3-1clang/lib/Basic/Targets/AArch64.cpp
+13-73 files

LLVM/project 8305195flang/test/Lower/OpenMP workshare-firstprivate.f90, flang/test/Lower/OpenMP/Todo workshare-firstprivate-polymorphic.f90

[flang][OpenMP] incorrect handling for local variable in OpenMP parallel workshare firstprivate(P) (#195616)

Changes to handle "!$omp parallel workshare firstprivate(P)" where P is
an array. Handling the creation and initialization of the local copy
properly.

This also Fixes
[195337](https://github.com/llvm/llvm-project/issues/195337) .

---------
 Sunil Kuravinakop <koops at hpe.com>
DeltaFile
+53-0flang/test/Lower/OpenMP/workshare-firstprivate.f90
+23-0flang/test/Lower/OpenMP/Todo/workshare-firstprivate-polymorphic.f90
+6-3llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
+82-33 files

LLVM/project 34b1799llvm/lib/Transforms/Scalar GVN.cpp, llvm/test/Transforms/GVN memoryssa-implies-no-memdep.ll

[GVN] Enforce MemDep/MemorySSA mutual exclusion for cl::opt overrides (#217896)

parseGVNOptions() already keeps the gvn<...> pass parameters mutually
exclusive, but the -enable-gvn-{memdep,memoryssa} cl::opt overrides
default independently. Two fixes for that path:

- Enabling MemorySSA now implies MemDep is off, so
-enable-gvn-memoryssa=true on its own no longer trips the on-demand
MemorySSA assertion.
- Explicitly enabling both is a contradiction and is now rejected with a
diagnostic instead of resolving it arbitrarily.
DeltaFile
+18-0llvm/test/Transforms/GVN/memoryssa-implies-no-memdep.ll
+15-0llvm/lib/Transforms/Scalar/GVN.cpp
+33-02 files

LLVM/project fbe6f04llvm/include/llvm/ADT StringMap.h, llvm/lib/Support SmallPtrSet.cpp

[ADT] Invalidate iterators on move and swap in SmallPtrSet and StringMap (#220796)

This patch adds missing incrementEpoch() calls to:

- StringMapImpl's move constructor.
- SmallPtrSetImplBase's moveHelper() (move construction and assignment).
- SmallPtrSetImplBase's swap().

This ensures that existing iterators pointing into moved-from or
swapped containers are properly invalidated in debug mode.

Assisted-by: Antigravity
DeltaFile
+31-0llvm/unittests/ADT/SmallPtrSetTest.cpp
+17-0llvm/unittests/ADT/StringMapTest.cpp
+17-0llvm/unittests/ADT/DenseMapTest.cpp
+4-0llvm/lib/Support/SmallPtrSet.cpp
+1-0llvm/include/llvm/ADT/StringMap.h
+70-05 files

LLVM/project 21a7b72llvm/lib/Target/AMDGPU AMDGPUTargetMachine.cpp AMDGPU.h

comments
DeltaFile
+18-25llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
+3-3llvm/lib/Target/AMDGPU/AMDGPU.h
+2-2llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+23-303 files

LLVM/project c591928llvm/test/CodeGen/AMDGPU/GlobalISel combine-zext-trunc.mir combine-rot.mir

comments
DeltaFile
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/combine-zext-trunc.mir
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/combine-rot.mir
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/combine-redundant-and.mir
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fabs-fneg.mir
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/combine-add-nullptr.mir
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/amdgpu-prelegalizer-combiner-crash.mir
+6-63 files not shown
+9-99 files

LLVM/project a2c6874llvm/lib/Target/AMDGPU AMDGPU.h AMDGPUTargetMachine.cpp

comments
DeltaFile
+22-30llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
+2-2llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPU.h
+25-333 files

LLVM/project d8d38ecllvm/test/CodeGen/AMDGPU/GlobalISel regbankcombiner-merge-readanylane.mir regbankcombiner-smed3.mir

comments
DeltaFile
+2-2llvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-smed3.mir
+2-2llvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-clamp-fmed3-const.mir
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-merge-readanylane.mir
+5-53 files

LLVM/project 9876525llvm/lib/Target/AMDGPU AMDGPUPassRegistry.def AMDGPURegBankSelect.cpp

comments
DeltaFile
+23-21llvm/lib/Target/AMDGPU/AMDGPURegBankSelect.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPUPassRegistry.def
+24-222 files

LLVM/project 1c05d75llvm/lib/Target/AMDGPU AMDGPUTargetMachine.cpp AMDGPUPassRegistry.def, llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-mui-regbankselect.mir

[AMDGPU][GIsel][NPM] Port "AMDGPURegBankSelect" to NPM
DeltaFile
+44-18llvm/lib/Target/AMDGPU/AMDGPURegBankSelect.cpp
+18-3llvm/lib/Target/AMDGPU/AMDGPU.h
+3-2llvm/lib/Target/AMDGPU/AMDGPUPassRegistry.def
+2-2llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+1-0llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-mui-regbankselect.mir
+68-255 files

LLVM/project 26d8497llvm/lib/Target/AMDGPU AMDGPUTargetMachine.cpp AMDGPU.h

comments
DeltaFile
+40-29llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPU.h
+42-313 files

LLVM/project ec9b371llvm/lib/Target/AMDGPU AMDGPUPassRegistry.def AMDGPUTargetMachine.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel regbankcombiner-smed3.mir regbankcombiner-clamp-fmed3-const.mir

[AMDGPU][GIsel][NPM] Port "AMDGPURegBankCombiner" to NPM
DeltaFile
+81-32llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
+13-2llvm/lib/Target/AMDGPU/AMDGPU.h
+2-2llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+1-2llvm/lib/Target/AMDGPU/AMDGPUPassRegistry.def
+2-0llvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-smed3.mir
+2-0llvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-clamp-fmed3-const.mir
+101-381 files not shown
+102-387 files

LLVM/project a911a38llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-mui-regbankselect.mir

comments
DeltaFile
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-mui-regbankselect.mir
+1-11 files

LLVM/project 7d3977fllvm/lib/Target/AMDGPU AMDGPUPassRegistry.def AMDGPUTargetMachine.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-mui.mir regbankselect-load.mir

[AMDGPU][GIsel][NPM] Port "AMDGPURegBankLegalize" to NPM
DeltaFile
+50-17llvm/lib/Target/AMDGPU/AMDGPURegBankLegalize.cpp
+21-3llvm/lib/Target/AMDGPU/AMDGPU.h
+2-2llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+3-0llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-load.mir
+1-1llvm/lib/Target/AMDGPU/AMDGPUPassRegistry.def
+1-0llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-mui.mir
+78-231 files not shown
+79-237 files

LLVM/project 3165623llvm/lib/Target/AMDGPU AMDGPUTargetMachine.cpp AMDGPUPassRegistry.def, llvm/test/CodeGen/AMDGPU/GlobalISel combine-zext-trunc.mir combine-rot.mir

[AMDGPU][GIsel][NPM] Port "AMDGPUPreLegalizerCombiner" to NPM
DeltaFile
+62-21llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
+8-1llvm/lib/Target/AMDGPU/AMDGPU.h
+2-1llvm/lib/Target/AMDGPU/AMDGPUPassRegistry.def
+1-1llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+1-0llvm/test/CodeGen/AMDGPU/GlobalISel/combine-zext-trunc.mir
+1-0llvm/test/CodeGen/AMDGPU/GlobalISel/combine-rot.mir
+75-244 files not shown
+79-2410 files

LLVM/project e82a925llvm/lib/Target/AMDGPU AMDGPU.td, llvm/lib/TargetParser AMDGPUTargetParser.cpp

[AMDGPU] Expose addressable LDS size features to TargetParser

Expose addressable LDS size through the per-GPU feature bitset without
serializing scalar settings into target-feature strings. Validate that
generic targets retain a conservative addressable size.

Change-Id: I3bc5265e190497817867fcaae16847d2eac81cf2
DeltaFile
+92-0llvm/test/TableGen/AMDGPUTargetDefErrors.td
+50-35llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+48-0llvm/unittests/TargetParser/TargetParserTest.cpp
+17-6llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+5-0llvm/lib/Target/AMDGPU/AMDGPU.td
+212-415 files

LLVM/project 2cc3423clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorRegions across region-branch ops

Six of the ten CIR ops implementing RegionBranchOpInterface reported the same
successors: any of their regions may be entered from the parent operation, and
every region exit goes back to it. Add a CIR_EnterAnyRegionBranchOpBase class
that appends that definition to the one inherited from CIR_RegionBranchOpBase,
retarget the six ops onto it and delete their hand-written definitions.

The shared definition walks getRegions() rather than naming region accessors.
For all six ops the entry regions were exactly the declared regions in
declaration order, so it reports the same successors in the same order. The doc
comments of the deleted ScopeOp and TernaryOp definitions go with them, instead
of being left behind on the neighbouring builders.

IfOp, GlobalOp, TryOp and AwaitOp stay on the base class, since their successors
depend on the operation: IfOp falls back to the parent when the else region is
empty, GlobalOp skips its optional ctor and dtor regions, TryOp iterates
variadic handler regions, and AwaitOp routes ready to resume and suspend.
DeltaFile
+0-77clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+27-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+27-832 files

LLVM/project f11b127clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorInputs across region-branch ops

The ten CIR ops implementing RegionBranchOpInterface each hand-wrote
getSuccessorInputs, and all ten bodies were equivalent: regions take no
inputs, and returning to the parent yields the parent's results. Three did
not look equivalent but are: CleanupScopeOp and CoroBodyOp returned an empty
ValueRange unconditionally and declare no results, and AwaitOp returned
region block arguments but carries NoRegionArguments, so those ranges are
always empty.

Add a CIR_RegionBranchOpBase ODS class that declares the method and generates
the single shared body through extraClassDefinition, mirroring the existing
CIR_LoopOpBase, and retarget all ten ops onto it.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
ten definitions removed from CIRDialect.cpp.
DeltaFile
+0-57clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+28-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+28-772 files

LLVM/project e0841e3clang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/unittests/CIR ControlFlowTest.cpp

[CIR] Add RegionBranchOpInterface unit tests and fix cir.await successors

Five of the ten ops implementing RegionBranchOpInterface have no unit test
coverage: cir.case, cir.cleanup.scope, cir.global, cir.await and
cir.coro.body. Add tests for all five.

Covering cir.await exposes a disagreement with its own terminator.
cir.condition terminates the ready region and reports {resume, suspend} as
its successors when the parent is an await, but AwaitOp::getSuccessorRegions
listed all three regions as entry successors and reported the parent op as
the successor of every region exit. Fix it to match cir.condition: ready is
the only entry successor, exiting ready branches to resume or suspend, and
exiting suspend or resume returns to the parent operation.

cir.await declares no results and carries NoRegionArguments, so successor
operand and input counts stay at zero along every edge and the MLIR verifier
is unaffected.
DeltaFile
+155-0clang/unittests/CIR/ControlFlowTest.cpp
+20-7clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+175-72 files

LLVM/project c2cc141orc-rt/lib/bedrock/linux TargetTriple.cpp, orc-rt/test/regression/linux lit.local.cfg check-rt-process-info.test

[orc-rt] Add very basic Linux triple detection. (#220814)
DeltaFile
+34-1orc-rt/lib/bedrock/linux/TargetTriple.cpp
+4-0orc-rt/test/regression/linux/check-rt-process-info.test
+2-0orc-rt/test/regression/linux/lit.local.cfg
+40-13 files

LLVM/project b4a2ef9llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPCostAnalysis.h SLPCostAnalysis.cpp

[SLP][modularisation][NFC] Move REVEC cost helpers to SLPCostAnalysis (#220594)

Move the following BoUpSLP-independent cost helpers out of
SLPVectorizer.cpp into SLPVectorizer/SLPCostAnalysis.{h,cpp}:

  getMaskedDivRemCost
  getScalarizationOverhead
  getVectorInstrCost
  getExtractWithExtendCost

These were deferred from the earlier SLPCostAnalysis extraction because
they read the SLPReVec cl::opt. SLPReVec stays static in
SLPVectorizer.cpp; the moved helpers take its value as an explicit bool
parameter. Behavior is unchanged.

Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
DeltaFile
+77-170llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+99-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCostAnalysis.cpp
+43-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCostAnalysis.h
+219-1703 files

LLVM/project e9b8a8allvm/lib/Target/AMDGPU GCNSubtarget.cpp AMDGPUAsmPrinter.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.h AMDGPUBaseInfo.cpp

[AMDGPU] Add getLDSAllocGranule to TargetParser

Expose the LDS allocation granule from GPUKind and subarch without an
MCSubtargetInfo. Consolidate backend users on the byte-valued query while
preserving the existing feature-based mapping.

Change-Id: Ic0c9345e7657ec3c6978a646628598cb7608b390
DeltaFile
+28-0llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+16-0llvm/unittests/TargetParser/TargetParserTest.cpp
+0-14llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+4-3llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+0-5llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+2-2llvm/lib/Target/AMDGPU/GCNSubtarget.cpp
+50-241 files not shown
+54-247 files

LLVM/project 41ff55cllvm/lib/Target/AMDGPU AMDGPU.td, llvm/lib/TargetParser AMDGPUTargetParser.cpp

[AMDGPU] Expose addressable LDS size features to TargetParser

Expose addressable LDS size through the per-GPU feature bitset without
serializing scalar settings into target-feature strings. Validate that
generic targets retain a conservative addressable size.

Change-Id: I3bc5265e190497817867fcaae16847d2eac81cf2
DeltaFile
+92-0llvm/test/TableGen/AMDGPUTargetDefErrors.td
+51-36llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+48-0llvm/unittests/TargetParser/TargetParserTest.cpp
+17-6llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+5-0llvm/lib/Target/AMDGPU/AMDGPU.td
+213-425 files

LLVM/project 4ddbc73llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer VecUtils.h, llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.h

[SandboxVectorizer] Dispatch LoadStoreVec::runOnRegion on seed kind
DeltaFile
+134-78llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.cpp
+52-34llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec.ll
+86-0llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec_load_seeds.ll
+2-47llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
+41-0llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
+22-4llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+337-1632 files not shown
+360-1718 files

LLVM/project 76c63f1flang/lib/Lower/OpenMP OpenMP.cpp, flang/lib/Semantics openmp-utils.cpp

[flang][OpenMP] Lower DO, SIMD, and DO SIMD metadirective variants (#218555)

A standalone metadirective and its associated loop are represented as
sibling PFT evaluations. For example:

```
  !$omp metadirective &
  !$omp& when(user={condition(flag)}: do) &
  !$omp& otherwise(nothing)
  do i = 1, n
    a(i) = i
  end do
```

has the following evaluation shape:

```
  METADIRECTIVE
  DO

    [25 lines not shown]
DeltaFile
+1,676-0flang/test/Lower/OpenMP/metadirective-loop.f90
+662-244flang/lib/Lower/OpenMP/OpenMP.cpp
+335-0flang/lib/Semantics/openmp-utils.cpp
+143-0flang/test/Lower/OpenMP/Todo/metadirective-loop-intervening-statement.f90
+111-0flang/test/Lower/OpenMP/Todo/metadirective-loop-unsupported-replacements.f90
+94-0flang/test/Lower/OpenMP/Todo/metadirective-loop-data-environment.f90
+3,021-24412 files not shown
+3,385-27818 files

LLVM/project 20d7165llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer VecUtils.h, llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.h

[SandboxVectorizer] Dispatch LoadStoreVec::runOnRegion on seed kind
DeltaFile
+134-78llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.cpp
+52-34llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec.ll
+86-0llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec_load_seeds.ll
+2-47llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
+41-0llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
+22-4llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+337-1632 files not shown
+360-1718 files

LLVM/project faaece7llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG switch-select-remap.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+165-104llvm/test/Transforms/SimplifyCFG/switch-select-remap.ll
+29-2llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+194-1062 files

LLVM/project 7dd738ellvm/test/Transforms/SimplifyCFG switch-select-remap.ll

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+161-69llvm/test/Transforms/SimplifyCFG/switch-select-remap.ll
+161-691 files

LLVM/project 22083dbllvm/test/Transforms/SimplifyCFG switch-select-remap.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+161-69llvm/test/Transforms/SimplifyCFG/switch-select-remap.ll
+161-691 files

LLVM/project bc3d8a4clang/lib/CIR/Dialect/Transforms CallConvLoweringPass.cpp, llvm/include/llvm/ABI FunctionInfo.h

[ABI] Add CanBeFlattened to ArgInfo for Direct struct coerces
DeltaFile
+43-0llvm/unittests/ABI/FunctionInfoTest.cpp
+12-2llvm/include/llvm/ABI/FunctionInfo.h
+7-4clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
+1-0llvm/utils/gn/secondary/llvm/unittests/ABI/BUILD.gn
+1-0llvm/unittests/ABI/CMakeLists.txt
+64-65 files