LLVM/project 627b8cf — llvm/include/llvm/Analysis ProfileSummaryInfo.h, llvm/lib/CodeGen MachineFunction.cpp

Revert "[ProfileSummaryInfo] Honor the hot function attribute in hotness queries" (#233334)

Reverts llvm/llvm-project#232085

Looks like https://github.com/llvm/llvm-project/pull/233298 broke one of
the tests. I'll fix it tomorrow and resubmit then.
DeltaFile
+0-90llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
+0-62llvm/test/Analysis/ProfileSummary/hot-attribute.ll
+4-35llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+0-37llvm/test/Transforms/TailCallElim/disable-tail-call-elim-for-cold-calls.ll
+0-19llvm/test/Analysis/ProfileSummary/hot-attribute-no-summary.ll
+2-8llvm/lib/CodeGen/MachineFunction.cpp
+6-2512 files not shown
+6-2668 files

LLVM/project 85f4557 — libc Maintainers.md

[libc] Add Kushal Pal(quic-k) as the maintainer for Hexagon (#232009)

@michaelrj-google @androm3da 
Hexagon port for libc merged
https://github.com/llvm/llvm-project/pull/217528

Signed-off-by: Kushal Pal <kushpal at qti.qualcomm.com>
Co-authored-by: Brian Cain <brian.cain at oss.qualcomm.com>
DeltaFile
+4-0libc/Maintainers.md
+4-01 files

LLVM/project 21740d6 — llvm/include/llvm/Analysis ProfileSummaryInfo.h, llvm/lib/CodeGen MachineFunction.cpp

[ProfileSummaryInfo] Honor the hot function attribute in hotness queries (#232085)

LangRef documents the `hot` function attribute as taking precedence over
profile information and acting as a manual alternative to PGO hotness
data when training inputs lack coverage for hot functions. However,
ProfileSummaryInfo only checked `Attribute::Cold` (in
isFunctionEntryCold) and never consulted `Attribute::Hot`. As a result,
functions marked `hot` that had zero entry counts in PGO profiles (for
example, newly introduced functions not executed during profile
collection) were still treated as cold by PSI queries, causing passes
such as TailCallElim and PGOForceFunctionAttrs to apply cold-function
heuristics.

Check `Attribute::Hot` in `isFunctionEntryHot`,
`isFunctionHotInCallGraph`, `isFunctionColdInCallGraph`, and
`isFunctionEntryCold` before checking `hasProfileSummary()` or
`Attribute::Cold`. This matches the precedence in CodeGenPrepare and
ensures the attribute is honored both with and without profile data.

Assisted-by: Gemini
DeltaFile
+90-0llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
+62-0llvm/test/Analysis/ProfileSummary/hot-attribute.ll
+35-4llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+37-0llvm/test/Transforms/TailCallElim/disable-tail-call-elim-for-cold-calls.ll
+19-0llvm/test/Analysis/ProfileSummary/hot-attribute-no-summary.ll
+8-2llvm/lib/CodeGen/MachineFunction.cpp
+251-62 files not shown
+266-68 files

LLVM/project 32207ab — lld/test/ELF icf7.s icf9.s

[ELF,test] Reorganize more ICF tests by the property they exercise (#233331)

Following #224567, group the remaining single-case ICF tests.
DeltaFile
+179-0lld/test/ELF/icf-relocation.s
+141-0lld/test/ELF/icf-section.s
+0-49lld/test/ELF/icf11.test
+0-44lld/test/ELF/icf-ineligible.s
+0-33lld/test/ELF/icf9.s
+0-30lld/test/ELF/icf7.s
+320-15624 files not shown
+344-56730 files

LLVM/project 2150809 — llvm/lib/Target/AMDGPU GCNFeatures.td, llvm/test/CodeGen/AMDGPU sad.ll

[AMDGPU] Remove XNACK from gfx12-5-generic

This affects downstream targets.
DeltaFile
+82-122llvm/test/CodeGen/AMDGPU/sad.ll
+0-2llvm/lib/Target/AMDGPU/GCNFeatures.td
+82-1242 files

LLVM/project a35c556 — llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 canonicalize-vars-f16-type.ll

[X86] Expand FCANONICALIZE for v8f16/v16f16 without AVX512F (#232129)

Without AVX512F, `llvm.canonicalize` on `<8 x half>` or `<16 x half>`
made llc abort with "Cannot select: v8f16 = fcanonicalize". That covers
default x86-64, `-mattr=+sse4.1` and haswell. v8f16 is legal from SSE2
and v16f16 from AVX, but the FCANONICALIZE Expand for these two types
was only set in the AVX512F block. Below AVX512F the node stayed Legal
and had no isel pattern.

The first commit is the patch I offered in the issue. It moves the two
Expand actions to where the types become legal: the SSE2 block for v8f16
and the AVX block for v16f16. Without F16C they then use the generic
expansion, which multiplies each element by 1.0 in f32, as v32f16
already does.

The second commit, from review here, adds FCANONICALIZE to the F16C
promote-to-f32 list next to FADD, FSUB, FMUL and FDIV. With F16C and
without AVX512FP16, v8f16 and v16f16 are then canonicalized as f32
vectors (vcvtph2ps, vmulps, vcvtps2ph) instead of element by element.

    [15 lines not shown]
DeltaFile
+666-19llvm/test/CodeGen/X86/canonicalize-vars-f16-type.ll
+4-3llvm/lib/Target/X86/X86ISelLowering.cpp
+670-222 files

LLVM/project 5470d75 — llvm/lib/Target/AMDGPU GCNFeatures.td

[AMDGPU] Remove XNACK from gfx12-5-generic

This affects downstream targets.
DeltaFile
+0-2llvm/lib/Target/AMDGPU/GCNFeatures.td
+0-21 files

LLVM/project 756e567 — llvm/lib/Target/RISCV/GISel RISCVLegalizerInfo.cpp, llvm/test/CodeGen/RISCV/GlobalISel half-convert.ll

[RISCV][GlobalISel] Use Zfhmin for G_FPTRUNC to f16 (#231370)

Zfhmin includes `FCVT.H.S` and (with D) `FCVT.H.D`, so `G_FPTRUNC` from
f32/f64 to f16 only requires Zfhmin.
Use libcalls when the required extensions are unavailable. This also
completes legalization of half-precision `G_FREM`.
DeltaFile
+84-0llvm/test/CodeGen/RISCV/GlobalISel/half-convert.ll
+19-13llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-frem-rv64.mir
+19-10llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-frem-rv32.mir
+3-4llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+125-274 files

LLVM/project 91c6a05 — llvm/lib/Target/RISCV RISCVISelLowering.h RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/GlobalISel memcpy-inline.ll

[RISCV][GISel] Implement LLT variant of allowsMisalignedMemoryAccesses (#232183)

Implement the LLT overload of `allowsMisalignedMemoryAccesses` using the
same rules as the existing EVT overload.

Without this override, GlobalISel's memcpy lowering falls back to the
default implementation, which returns false even when
`+unaligned-scalar-mem` is enabled. This causes byte-by-byte expansion
instead of wider loads and stores.

Found while doing fuzzing:
https://broken.life/llvm-fuzz/run/main-04ca53e65f-20261014-113325/regression-memcpy-inline-ll-unaligned-memcpy31-0cca91db.html

Godbolt: https://godbolt.org/z/Pv3hqGWY9
DeltaFile
+134-0llvm/test/CodeGen/RISCV/GlobalISel/memcpy-inline.ll
+22-0llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+5-0llvm/lib/Target/RISCV/RISCVISelLowering.h
+161-03 files

LLVM/project 32ec290 — llvm/test/CodeGen/RISCV rvp-scalar-rv64.ll rv64p.ll

[RISCV][P-ext] Restructure scalar tests to increase testing and reduce duplicaton. NFC (#232613)

Rename rv32p.ll to rvp-scalar.ll and add RV64 RUN line. This improves
coverage of some operations like i8/i16 saturating adds/subs that don't
have direct P extension instructions but might use some P instructions
in their lowering like sati. Or it may show cases where we should insert
a scalar into a packed instruction to reduce the code.

Rename rv64p.ll to rvp-scalar-rv64.ll and remove anything thats in
rvp-scalar.ll.
DeltaFile
+3,770-0llvm/test/CodeGen/RISCV/rvp-scalar.ll
+0-1,971llvm/test/CodeGen/RISCV/rv64p.ll
+1,368-0llvm/test/CodeGen/RISCV/rvp-scalar-rv64.ll
+5,138-1,9713 files

LLVM/project 63ad000 — llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG/X86 switch-to-lookup-masked-profile.ll

Revert "[SimplifyCFG] Mark branch weights unknown in masked switch to lookup" (#233325)

Reverts llvm/llvm-project#233321

Breaks the profcheck bot and needs more investigation.
DeltaFile
+0-48llvm/test/Transforms/SimplifyCFG/X86/switch-to-lookup-masked-profile.ll
+2-13llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+2-612 files

LLVM/project 299c65b — llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG/X86 switch-to-lookup-masked-profile.ll

[SimplifyCFG] Mark branch weights unknown in masked switch to lookup (#233321)

We cannot infer the branch weights because this transformation splits
the default case into two (values fully out of range, and holes inside
the range), which we cannot infer without additional value profiling.
DeltaFile
+48-0llvm/test/Transforms/SimplifyCFG/X86/switch-to-lookup-masked-profile.ll
+13-2llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+61-22 files

LLVM/project 2eeab11 — mlir/lib/Dialect/Arith/Transforms IntRangeOptimizations.cpp, mlir/test/Dialect/Arith int-range-narrowing.mlir

[mlir][arith] Drop invalid overflow flags when narrowing

Preserve nsw only when narrowing preserves signed operand and result
values, and nuw only when it preserves unsigned values. Flags proven
at the original width may otherwise introduce poison after narrowing.

Add concrete regression cases for addi, subi, muli, and shli, covering
both overflow flags and retention of valid flags.
DeltaFile
+162-0mlir/test/Dialect/Arith/int-range-narrowing.mlir
+13-0mlir/lib/Dialect/Arith/Transforms/IntRangeOptimizations.cpp
+175-02 files

LLVM/project 6f050bd — mlir/lib/Dialect/Arith/Transforms IntRangeOptimizations.cpp, mlir/test/Dialect/Arith int-range-narrowing.mlir

[mlir][arith] Preserve unsigned values when narrowing operations

Require unsigned representability for divui, ceildivui, remui, and shrui.
A signed range fitting the narrower type does not preserve the unsigned
operand values, even when the result fits.

Add concrete counterexamples and coverage for safe narrowing of
zero-extended and proven nonnegative operands.
DeltaFile
+95-0mlir/test/Dialect/Arith/int-range-narrowing.mlir
+4-3mlir/lib/Dialect/Arith/Transforms/IntRangeOptimizations.cpp
+99-32 files

LLVM/project 027f799 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPMemoryUtils.cpp

[SLP] Handle REVEC when costing expanded compress mask

With REVEC the scalars are vectors. The masked-load-compress shuffle that is
emitted uses the compress mask expanded to the elements of those vectors
(transformScalarShuffleIndiciesToVector), but the cost was computed with the
unexpanded per-vector mask, so a shuffle such as <24 x i8> -> <16 x i8> was
costed as a <2 x i8> shuffle. This made the compress sequence looked cheaper
than it is.

Assisted-By: Claude Sonnet 5.5
DeltaFile
+13-9llvm/test/Transforms/SLPVectorizer/RISCV/revec-compress-mask-cost.ll
+7-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+6-2llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPMemoryUtils.cpp
+26-133 files

LLVM/project 8260e83 — flang/lib/Semantics check-omp-atomic.cpp check-omp-structure.h, flang/test/Semantics/OpenMP declare-target02.f90 flush02.f90

[flang][OpenMP] Switch clause verification to descriptor-based

Delete all the scattered pieces of clause verification that are now
replaced by the unified handling.
DeltaFile
+57-273flang/lib/Semantics/check-omp-structure.cpp
+300-0flang/lib/Semantics/check-omp-syntax.cpp
+22-10flang/lib/Semantics/check-omp-structure.h
+0-31flang/lib/Semantics/check-omp-atomic.cpp
+8-8flang/test/Semantics/OpenMP/flush02.f90
+15-0flang/test/Semantics/OpenMP/declare-target02.f90
+402-32237 files not shown
+517-38443 files

LLVM/project 31a65fa — flang/test/Semantics/OpenMP to-clause-v45.f90 from-clause-v45.f90

Update tests
DeltaFile
+1-1flang/test/Semantics/OpenMP/to-clause-v45.f90
+1-1flang/test/Semantics/OpenMP/from-clause-v45.f90
+2-22 files

LLVM/project 6f485b6 — flang/lib/Semantics check-omp-syntax.cpp, flang/test/Semantics/OpenMP uses-allocators-version51.f90 uses-allocators-version50.f90

[flang][OpenMP] Improve diagnostics about modifier properties

Use OpenMPDeprecated and OpenMPFuture warning categories for modifier
diagnostics as well, analogously to how they are used for clauses.
DeltaFile
+67-31flang/lib/Semantics/check-omp-syntax.cpp
+4-4flang/test/Semantics/OpenMP/map-modifiers-v60.f90
+3-3flang/test/Semantics/OpenMP/uses-allocators-version50.f90
+3-3flang/test/Semantics/OpenMP/to-clause-v45.f90
+3-3flang/test/Semantics/OpenMP/from-clause-v45.f90
+2-2flang/test/Semantics/OpenMP/uses-allocators-version51.f90
+82-466 files not shown
+89-5312 files

LLVM/project 816ecf6 — flang/test/Semantics/OpenMP to-clause-v45.f90 from-clause-v45.f90

Update tests
DeltaFile
+1-1flang/test/Semantics/OpenMP/to-clause-v45.f90
+1-1flang/test/Semantics/OpenMP/from-clause-v45.f90
+2-22 files

LLVM/project 0595779 — flang/include/flang/Parser openmp-utils.h, flang/lib/Semantics check-omp-structure.h check-omp-syntax.cpp

[flang][OpenMP] Account for using different versions for modifier checks (#229525)

When a modifier from a past/future version is accepted, use its
properties
from the nearest version in which it is allowed.
DeltaFile
+118-75flang/lib/Semantics/check-omp-syntax.cpp
+7-0flang/test/Semantics/OpenMP/to-clause-v45.f90
+7-0flang/test/Semantics/OpenMP/from-clause-v45.f90
+3-1flang/include/flang/Parser/openmp-utils.h
+2-1llvm/include/llvm/Frontend/Directive/Spelling.h
+1-0flang/lib/Semantics/check-omp-structure.h
+138-776 files

LLVM/project 608fabb — flang/include/flang/Parser openmp-utils.h, flang/lib/Parser openmp-utils.cpp

[flang][OpenMP] Create generic interfaces for "container" entities (#229524)

In short, clauses are containers of modifiers, and directives are
containers of clauses. With the abstractions in place, clauses and
modifiers look almost the same from the point of view of syntactic
properties.

Use these functions to implement generic GetAllowedElements and
GetElementVersionRange functions.
DeltaFile
+17-55flang/lib/Semantics/check-omp-syntax.cpp
+56-0flang/include/flang/Parser/openmp-utils.h
+31-0flang/lib/Parser/openmp-utils.cpp
+104-553 files

LLVM/project aecafbb — llvm/include/llvm/Support SourceMgrDiagnosticVerifier.h, llvm/lib/Support SourceMgrDiagnosticVerifier.cpp

[nspr] initial commit
DeltaFile
+45-14llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp
+20-0llvm/unittests/Support/SourceMgrDiagnosticVerifierTest.cpp
+15-4llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
+80-183 files

LLVM/project a5a3688 — llvm/include/llvm/Support SourceMgrDiagnosticVerifier.h, llvm/lib/Support SourceMgrDiagnosticVerifier.cpp

[nspr] initial commit
DeltaFile
+123-0llvm/unittests/Support/SourceMgrDiagnosticVerifierTest.cpp
+67-51llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp
+49-46llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
+12-17mlir/lib/IR/Diagnostics.cpp
+1-0llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn
+1-0llvm/unittests/Support/CMakeLists.txt
+253-1146 files

LLVM/project ba7e0ef — llvm/include/llvm/Support SourceMgrDiagnosticVerifier.h

Declare MatchResult before ExpectedDiag so that a later commit does not have to move it (no functional change).
DeltaFile
+16-16llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
+16-161 files

LLVM/project 1d80b2c — llvm/include/llvm/Support SourceMgrDiagnosticVerifier.h, llvm/lib/Support SourceMgrDiagnosticVerifier.cpp

[nspr] initial commit
DeltaFile
+125-125llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp
+37-37llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
+162-1622 files

LLVM/project 5fda771 — llvm/lib/IR Verifier.cpp, llvm/test/Verifier hot-cold-incompatible.ll

[IR] Reject IR functions that have hot and cold attributes (#233298)

These are mutually exclusive and clang already enforces this. We should
just reject this in the verifier so that passes don't have to think
about precedence of these two attributes.
DeltaFile
+8-0llvm/test/Verifier/hot-cold-incompatible.ll
+4-0llvm/lib/IR/Verifier.cpp
+12-02 files

LLVM/project 04def51 — llvm/lib/Analysis LoopAccessAnalysis.cpp, llvm/test/Analysis/LoopAccessAnalysis calls-with-operand-bundles.ll

[LAA] Reject calls with operand bundles that may access memory. (#233304)

Calls to vectorizable intrinsics and vector-variant calls skipped the
memory check, so bundles that may access memory (e.g. deopt) were
ignored. In LV this hoisted, removed or mis-widened such calls.

Reject bundles conservatively for now to fix miscompiles. We can make
this more fine-grained if needed in practice.
DeltaFile
+131-95llvm/test/Transforms/LoopVectorize/operand-bundles.ll
+22-27llvm/test/Transforms/LoopVectorize/X86/funclet.ll
+10-18llvm/test/Transforms/LoopVectorize/widen-intrinsic.ll
+9-0llvm/lib/Analysis/LoopAccessAnalysis.cpp
+2-2llvm/test/Analysis/LoopAccessAnalysis/calls-with-operand-bundles.ll
+174-1425 files

LLVM/project 64dfab6 — llvm/docs Vectorizers.md

[DOCS][SLP][NFC]Fix non-vectoriable example in docs, NFC

Fixes #230067

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/233315
DeltaFile
+1-1llvm/docs/Vectorizers.md
+1-11 files

LLVM/project 1886659 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 buildvector-cross-product.ll

[SLP]Allow non-power-of-2 VF for partial register buildvectors

The buildvector, not filling the whole registers (e.g. <3 x float>),
was vectorized as the power-of-2 part plus the scalar remainder. The
type is widened to the full registers anyway, so vectorize it as a
whole.

Partially fixes #56332

Assisted-by: Cursor

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/233314
DeltaFile
+16-33llvm/test/Transforms/SLPVectorizer/X86/buildvector-cross-product.ll
+16-8llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+32-412 files

LLVM/project bab8bff — llvm/test/Transforms/SLPVectorizer/X86 buildvector-cross-product.ll

[SLP][NFC]Add a test for cross product, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/233311
DeltaFile
+180-0llvm/test/Transforms/SLPVectorizer/X86/buildvector-cross-product.ll
+180-01 files