LLVM/project 9f4e8bclld/include/lld/Common BPSectionOrdererBase.inc

[lld][BP] Fix nondeterministic function order by using MapVector (#179841)

There are two places where the nondeterministic iteration order of
`DenseMap` (the original type of `startupSectionIdxUNs`) causes the
output function order to be nondeterministic.


https://github.com/llvm/llvm-project/blob/16e2e7f59134e63810228c9a0dc990bfd96f9a1f/lld/include/lld/Common/BPSectionOrdererBase.inc#L240-L245


https://github.com/llvm/llvm-project/blob/16e2e7f59134e63810228c9a0dc990bfd96f9a1f/lld/include/lld/Common/BPSectionOrdererBase.inc#L267-L268

The fix is to use `MapVector` whose iteration order is guaranteed to be
deterministic.

To test, I built a large binary several times and observed this value no
longer changes.

https://github.com/llvm/llvm-project/blob/16e2e7f59134e63810228c9a0dc990bfd96f9a1f/lld/include/lld/Common/BPSectionOrdererBase.inc#L410-L411

    [2 lines not shown]
DeltaFile
+2-2lld/include/lld/Common/BPSectionOrdererBase.inc
+2-21 files

LLVM/project b08e565mlir/include/mlir/IR BuiltinTypeInterfaces.td, mlir/lib/IR BuiltinTypes.cpp

address comments
DeltaFile
+42-76mlir/lib/IR/BuiltinTypes.cpp
+1-2mlir/include/mlir/IR/BuiltinTypeInterfaces.td
+43-782 files

LLVM/project 544caa6llvm/lib/Analysis StaticDataProfileInfo.cpp, llvm/lib/Transforms/Instrumentation MemProfUse.cpp

[StaticDataLayout] Reconcile string literal hotness from data access profiles and PGO profiles. (#178336)

https://github.com/llvm/llvm-project/pull/178333 updates the memprof
pass to annotate string literal section prefix.

The StaticDataProfileInfo.cpp provides an analysis pass to reconcile
global variable hotness. It's used by StaticDataAnnotator and AsmPrinter
to look up global variable hotness.

This PR updates the analysis pass to compute the hotness of string
literals.
* When both data access profiles and pgo counters provide a hotness
attribute, use the hotter one.
* Otherwise, use the hotness attribute that's available.

Implementation-wise, the option `AnnotateStringLiteralSectionPrefix` is
moved from MemProf (a transform pass) to StaticDataProfileInfo (an
Analysis pass). Otherwise, there might be errors like caught by CI. Note
https://github.com/llvm/llvm-project/pull/178336#issuecomment-3808537817

    [11 lines not shown]
DeltaFile
+56-13llvm/test/CodeGen/X86/global-variable-partition-with-dap.ll
+23-5llvm/lib/Analysis/StaticDataProfileInfo.cpp
+1-8llvm/lib/Transforms/Instrumentation/MemProfUse.cpp
+80-263 files

LLVM/project 64de25dllvm/lib/Transforms/Instrumentation MemorySanitizer.cpp, llvm/test/Instrumentation/MemorySanitizer/AArch64 arm64-vcmp.ll

[msan] Handle NEON floating-point absolute compare greater than/equal (#180120)

Uses existing handleVectorComparePackedIntrinsic()
DeltaFile
+41-105llvm/test/Instrumentation/MemorySanitizer/AArch64/arm64-vcmp.ll
+9-0llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+50-1052 files

LLVM/project 762c32amlir/include/mlir/Dialect/AMDGPU/IR AMDGPUOps.td AMDGPUTypes.td, mlir/lib/Conversion/AMDGPUToROCDL AMDGPUToROCDL.cpp

[mlir][AMDGPU] Add wrappers for in-memory barriers on gfx1250 (#180112)

This commit introduces the `!amdgpu.ds_barrier_state` type and
operations on that type, including extracting its components and (more
importantly) provides wrappers around the upcoming barrier-management
instructions that will be added in gfx1250.

This commit is loosely based on work done for Triton, but this commit
provides slightly more lower level-primitives (namely a known-atomic
load for getting the barrier state instead of providing a `wait`
operation that includes an entire spin-loop, though if people want one
we could consider adding it.) These operations will allow LDS barriers
to be interacted with in a more type-safe manner.

The types and operations use the Ds naming scheme to match the
underlying instructions and to avoid confusion with the "LDS barrier"
already present in the AMDGPU dialect that was a workaround for LLVM's
memory fencing support.


    [6 lines not shown]
DeltaFile
+262-3mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
+216-0mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUOps.td
+92-2mlir/test/Conversion/AMDGPUToROCDL/gfx1250.mlir
+29-0mlir/lib/Dialect/AMDGPU/IR/AMDGPUOps.cpp
+25-0mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUTypes.td
+24-0mlir/test/Dialect/AMDGPU/invalid.mlir
+648-51 files not shown
+670-57 files

LLVM/project 368d7eamlir/include/mlir/Dialect/GPU/IR GPUOps.td, mlir/test/Conversion/ConvertToSPIRV gpu.mlir

[mlir][gpu] Add NoMemoryEffect to gpu.subgroup_reduce op (#180227)

Add missing MemoryEffectOpInterface to gpu.subgroup_reduce

Signed-off-by: Fabrizio Indirli <fabrizio.indirli at arm.com>
DeltaFile
+12-6mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
+3-2mlir/test/Conversion/ConvertToSPIRV/gpu.mlir
+1-1mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
+16-93 files

LLVM/project 9f8f901lldb/test/Shell/helper toolchain.py

Revert "[lldb-dap] fix executable substitution in tests (#179685)" (#180241)

This reverts commit 082a47d8944da242993bf28980b07f2c8c3df4a6.

`ToolSubst` should only be used explicitely for passing `extra_args`.
DeltaFile
+1-3lldb/test/Shell/helper/toolchain.py
+1-31 files

LLVM/project c32cde4llvm/include/llvm/Analysis ScalarEvolutionPatternMatch.h, llvm/lib/Transforms/Utils ScalarEvolutionExpander.cpp

[SCEVExp] Use SCEVPtrToAddr in tryToReuseLCSSAPhi if possible. (#178727)

This patch updates tryToReuseLCSSAPhi to use SCEVPtrToAddr, unless using
SCEVPtrToInt allows re-use, because the IR already contains a re-usable
phi using PtrToInt.

This is a first step towards migrating to SCEVPtrToAddr and avoids
regressions in follow-up changes.

PR: https://github.com/llvm/llvm-project/pull/178727
DeltaFile
+28-15llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+6-0llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h
+3-3llvm/test/Transforms/LoopVectorize/reuse-lcssa-phi-scev-expansion.ll
+2-2llvm/test/Transforms/LoopIdiom/reuse-lcssa-phi-scev-expansion.ll
+39-204 files

LLVM/project 4ad58b4. .gitignore

[llvm][.gitignore] macOS case-sensitive update (#177971)

If you run macOS on a case-sensitive file system, .DS_store and .DS_Store are different files and the existing lowercase-s version doesn't match. Fix that with the intended case sensitive.
DeltaFile
+2-2.gitignore
+2-21 files

LLVM/project 73b83beflang/docs Extensions.md, flang/include/flang/Support Fortran-features.h

[flang] Add warning and documentation for extension (#179708)

When a pointer component has no default initialization in the derived
type definition and does not appear explicitly as a component in a
structure constructor, we assume that it is meant to be NULL() as an
extension. But there's no warning or documentation for this extension;
add them.

Fixes https://github.com/llvm/llvm-project/issues/179580.
DeltaFile
+9-0flang/test/Semantics/bug179580.f90
+8-0flang/lib/Semantics/expression.cpp
+2-1flang/include/flang/Support/Fortran-features.h
+2-0flang/docs/Extensions.md
+21-14 files

LLVM/project d1d9413llvm/lib/Transforms/Vectorize VPlanPredicator.cpp

[VPlan] Don't use std::not_fn

It looks like some Apple based toolchains can't compile this:
https://github.com/llvm/llvm-project/pull/180005#issuecomment-3861614477

There aren't any other users of std::not_fn within LLVM so just use a
lambda for now.
DeltaFile
+3-3llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
+3-31 files

LLVM/project c15ae96flang/lib/Semantics check-call.cpp, flang/test/Semantics bug2131b.cuf bug1214.cuf

[flang][CUDA] Better analysis of actual argument CUDA data attrs (#179569)

When checking an actual argument for any CUDA data attributes, be sure
to check the symbols in a designator like a%b%c in order, taking the
last symbol that has a CUDA attribute. And be sure to interpret a
function result symbol of a device function as a device object, at least
for generic interface resolution for defined assignments and operators.

This patch exposed errors in flang/test/Semantics/bug1214.cuf, which
have been fixed.
DeltaFile
+33-0flang/test/Semantics/bug2131b.cuf
+13-7flang/lib/Semantics/check-call.cpp
+2-2flang/test/Semantics/bug1214.cuf
+48-93 files

LLVM/project 9d0043aflang/include/flang/Evaluate check-expression.h, flang/include/flang/Semantics expression.h

[flang] Refactor "unused"/"used without definition" warnings (#179539)

I'm emitting a false warning "used without definition" warning for
variable cited in an inquiry intrinsic (e.g. LBOUND), and failing to
emit an "unused local" warning for allocatables that only appear in
ALLOCATE statements.

This patch makes the analysis more context-aware by rewriting it in
terms of typed expression traversal, and moves the analysis part into
Evaluate/check-expression.cpp from Semantics/expression.cpp.
DeltaFile
+117-0flang/lib/Evaluate/check-expression.cpp
+3-87flang/lib/Semantics/expression.cpp
+17-12flang/include/flang/Semantics/expression.h
+12-0flang/lib/Evaluate/tools.cpp
+0-12flang/lib/Semantics/tools.cpp
+9-0flang/include/flang/Evaluate/check-expression.h
+158-1116 files not shown
+174-11412 files

LLVM/project 621fe67flang-rt/lib/runtime external-unit.cpp pseudo-unit.cpp

[flang] Better "out of memory" error for failure to allocate a unit (#179291)

When the I/O runtime fails to allocate storage for an I/O unit, the
error message cites a source location in the runtime library, not the
user program. Thread instances of Terminator through to the code that
attempts the allocation so that the failure has a source position in the
user's program.
DeltaFile
+21-19flang-rt/lib/runtime/external-unit.cpp
+18-14flang-rt/lib/runtime/pseudo-unit.cpp
+14-8flang-rt/lib/runtime/io-api.cpp
+9-6flang-rt/lib/runtime/extensions.cpp
+6-6flang-rt/lib/runtime/unit.h
+3-3flang-rt/lib/runtime/io-stmt.cpp
+71-561 files not shown
+73-587 files

LLVM/project 7dc79cfllvm/lib/Target/AMDGPU AMDGPUISelLowering.cpp AMDGPULegalizerInfo.cpp, llvm/test/CodeGen/AMDGPU llvm.log.ll llvm.log10.ll

AMDGPU: Use promotion to f32 path for log/log10 for f16 by default

While the current implementation passes OpenCL conformance, it is not
correctly rounded with an error of 1.79 ulp according to the conformance
test. Default to the promotion path without afn. In the future we should
make use of !fpmath metadata but that's not wired into the backend, or
from any frontend producer.
DeltaFile
+638-388llvm/test/CodeGen/AMDGPU/llvm.log.ll
+638-388llvm/test/CodeGen/AMDGPU/llvm.log10.ll
+16-6llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+5-1llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+1,297-7834 files

LLVM/project 4afce0cllvm/lib/Target/AArch64 AArch64InstrInfo.td

[AArch64] Correct spelling of INSERT_SUBREF->INSERT_SUBREG. NFC
DeltaFile
+1-1llvm/lib/Target/AArch64/AArch64InstrInfo.td
+1-11 files

LLVM/project bd19bfellvm/lib/Transforms/Instrumentation MemorySanitizer.cpp, llvm/test/Instrumentation/MemorySanitizer switch-icmp.ll

[msan] Switch switch() from strict handling to (icmp eq)-style handling (#179851)

Currently, the SwitchInst:
```
switch i32 %Val, label %else [ i32 0, label %A
                               i32 1, label %B
                               i32 2, label %C ]
```
is strictly handled i.e., MSan will check that %Val is fully
initialized. This is appropriate nearly all the time.

However, sometimes the compiler may convert (icmp + br) into a switch
statement. (icmp + br) has different semantics: MSan allows icmp eq/ne
with partly initialized inputs to still result in a fully initialized
output, if there exists a bit that is initialized in both inputs with a
differing value e.g., suppose:
```
%A   = 00000000 00001010
%B   = 00000000 00000110

    [18 lines not shown]
DeltaFile
+41-0llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+20-5llvm/test/Instrumentation/MemorySanitizer/switch-icmp.ll
+61-52 files

LLVM/project 918d576llvm/include/llvm/Transforms/Utils VNCoercion.h, llvm/lib/Transforms/Utils VNCoercion.cpp

[NFC][LLVM] Code cleanup in VNCoercion (#180159)

Use namespace qualifiers to define functions declared in the
`VNCoercion` namespace to conform to LLVM CS.
DeltaFile
+32-25llvm/lib/Transforms/Utils/VNCoercion.cpp
+8-3llvm/include/llvm/Transforms/Utils/VNCoercion.h
+40-282 files

LLVM/project 017ca73llvm/lib/Transforms/InstCombine InstructionCombining.cpp, llvm/lib/Transforms/Vectorize LoadStoreVectorizer.cpp

[NFC][LLVM] Remove pass initialization from pass constructors (#180158)

DeltaFile
+2-4llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+1-4llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
+3-82 files

LLVM/project b12e312llvm/lib/CodeGen GlobalMergeFunctions.cpp InsertCodePrefetch.cpp, llvm/lib/IR Verifier.cpp Dominators.cpp

[NFC][Core][CodeGen] Remove pass initialization from pass constructors (#180153)

DeltaFile
+2-7llvm/lib/IR/Verifier.cpp
+1-6llvm/lib/CodeGen/GlobalMergeFunctions.cpp
+1-3llvm/lib/IR/Dominators.cpp
+1-3llvm/lib/IR/SafepointIRVerifier.cpp
+1-3llvm/lib/CodeGen/InsertCodePrefetch.cpp
+2-0llvm/lib/CodeGen/CodeGen.cpp
+8-226 files

LLVM/project 295eba2llvm/lib/Target/AMDGPU AMDGPUPrepareAGPRAlloc.cpp AMDGPUArgumentUsageInfo.h

[NFC][AMDGPU] Remove pass initialization from pass constructors (#180149)

DeltaFile
+3-8llvm/lib/Target/AMDGPU/AMDGPUPrepareAGPRAlloc.cpp
+1-6llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h
+1-4llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
+1-4llvm/lib/Target/AMDGPU/AMDGPUUniformIntrinsicCombine.cpp
+1-4llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
+1-3llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp
+8-299 files not shown
+17-5615 files

LLVM/project 55ecf62llvm/test/TableGen MacroFusion.td, llvm/utils/TableGen MacroFusionPredicatorEmitter.cpp

[NFC][TableGen] Adopt CodeGenHelpers in MacroFusion emitter (#180132)

DeltaFile
+9-16llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp
+8-4llvm/test/TableGen/MacroFusion.td
+17-202 files

LLVM/project 92476c1clang/include/clang/Analysis/Analyses/LifetimeSafety LifetimeAnnotations.h, clang/lib/Analysis/LifetimeSafety LifetimeAnnotations.cpp FactsGenerator.cpp

handle unique_ptr::release
DeltaFile
+20-0clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
+12-0clang/test/Sema/warn-lifetime-safety.cpp
+11-0clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+5-0clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h
+1-0clang/test/Sema/Inputs/lifetime-analysis.h
+49-05 files

LLVM/project 1b0d9d5llvm/utils/gn/secondary/clang/lib/Parse BUILD.gn

[gn build] Port 1171450d56e2
DeltaFile
+1-0llvm/utils/gn/secondary/clang/lib/Parse/BUILD.gn
+1-01 files

LLVM/project 50ec075clang/include/clang/Analysis/Analyses/LifetimeSafety LifetimeAnnotations.h, clang/lib/Analysis/LifetimeSafety LifetimeAnnotations.cpp FactsGenerator.cpp

handle unique_ptr::release
DeltaFile
+22-0clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
+12-0clang/test/Sema/warn-lifetime-safety.cpp
+9-0clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+5-0clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h
+1-0clang/test/Sema/Inputs/lifetime-analysis.h
+49-05 files

LLVM/project caee8f0llvm/lib/Target/RISCV RISCVInstrInfoP.td, llvm/test/MC/RISCV rv32p-valid.s rv32p-invalid.s

[RISCV] Add ppair.e and ppaire.w as aliases for pack on RV32 and RV64 respectively (#180100)

Based on this note from
https://jhauser.us/RISCV/ext-P/RVP-baseInstrs-018.pdf

(*1) For RV32, PPAIRE.H is a pseudoinstruction for PACK.
(*2) For RV64, PPAIRE.W is a pseudoinstruction for PACK.
DeltaFile
+6-0llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+3-0llvm/test/MC/RISCV/rv32p-valid.s
+1-2llvm/test/MC/RISCV/rv32p-invalid.s
+3-0llvm/test/MC/RISCV/rv64p-valid.s
+13-24 files

LLVM/project a35ededoffload/test lit.cfg

Revert "Revert "[Offload][lit] Link against SPIR-V DeviceRTL if present" (#18…"

This reverts commit 6844af142e5c8309055bcf107b57161f5c7801fe.
DeltaFile
+3-2offload/test/lit.cfg
+3-21 files

LLVM/project 68d7048lldb/source/Plugins/ExpressionParser/Clang ClangUserExpression.cpp ClangUserExpression.h, lldb/test/API/lang/cpp/template-diagnostic-hint TestTemplateDiagnosticHint.py main.cpp

[lldb][ClangUserExpression] Emit workaround hint when trying to call function templates (#179916)

Before:
```
(lldb) expression some_template_func<int, long>(5)
                  ˄
                  ╰─ error: 'some_template_func' does not name a template but is followed by template arguments
note: Ran expression as 'C++14'.
note: note: non-template declaration found by name lookup
```

After:
```
(lldb) expression some_template_func<int, long>(5)
                  ˄
                  ╰─ error: 'some_template_func' does not name a template but is followed by template arguments
note: Ran expression as 'C++14'.
note: note: non-template declaration found by name lookup
note: Naming template instantiation not yet supported. Template functions can be invoked via their mangled name. E.g., expression _Z3fooIiEvi(5)

    [20 lines not shown]
DeltaFile
+48-0lldb/test/API/lang/cpp/template-diagnostic-hint/TestTemplateDiagnosticHint.py
+25-0lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+14-0lldb/test/API/lang/cpp/template-diagnostic-hint/main.cpp
+3-0lldb/test/API/lang/cpp/template-diagnostic-hint/Makefile
+3-0lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+93-05 files

LLVM/project 115158bclang/test/Driver openmp-target-fast-flag.c

[clang][OpenMP][test] Use `-fopenmp=libomp` explicitly (#180221)

Using `-fopenmp` uses the default openmp lib, which defaults to `libomp`
but may be something else. This test only passes with `libomp`, so it
passes when using all defaults, but fails downstream if configured for
something else, like `libgomp`.
DeltaFile
+7-7clang/test/Driver/openmp-target-fast-flag.c
+7-71 files

LLVM/project 29891ecllvm/test/CodeGen/X86 pr142937.ll

[SelectionDAG] Use -filetype=null for llc RUN lines in pr142937 (#180004)

This patch adds -filetype=null to the llc RUN lines in pr142937.ll, to
ensure that the test does not attempt to write files to the local
directory.

Follow-up to #179249.
DeltaFile
+2-2llvm/test/CodeGen/X86/pr142937.ll
+2-21 files