LLVM/project 3cb8965flang/include/flang/Semantics openmp-modifiers.h, flang/lib/Semantics check-omp-structure.cpp openmp-modifiers.cpp

[OpenMP] Preview of auto-generating OpenMP definitions

The components of this commit:
1. Definitions of descriptors that will hold relevant data in LLVM
   and declarations of associated functions.
2. "Auto-generated" enum definitions and descriptor data
3. Changes to flang's modifier verification to use the new data
   instead of the previously hand-coded modifier information.

This does not contain the actual auto-generation infrastructure.
The included descriptors were generated directly from JSON files by
a custom python script.
DeltaFile
+6,582-0llvm/lib/Frontend/OpenMP/OMPDescriptors.cpp
+0-791flang/lib/Semantics/openmp-modifiers.cpp
+277-0llvm/include/llvm/Frontend/OpenMP/OMPDescriptors.h
+136-111flang/include/flang/Semantics/openmp-modifiers.h
+9-25flang/lib/Semantics/check-omp-structure.cpp
+10-19flang/test/Parser/OpenMP/map-modifiers.f90
+7,014-94611 files not shown
+7,035-98317 files

LLVM/project 8b6f3dcclang/include/clang/Analysis/Analyses/LifetimeSafety Facts.h, clang/include/clang/Basic DiagnosticGroups.td

[LifetimeSafety] Suppress dangling field warnings for RAII resetters in permissive mode
 (#214212)

In `-Wlifetime-safety-permissive` mode, suppress dangling field warnings
(`-Wlifetime-safety-dangling-field`) when `this` or the escaping field
declaration is captured by a lambda within the function. This accounts
for common RAII field resetters that clean up dangling pointers on scope
exit.

### Motivating Example
Dangling field analysis can report false positives when an RAII field
resetter (such as `absl::MakeCleanup` or `absl::Cleanup`) captures
`this` or the field to reset the pointer before function exit:

```cpp
struct TimeServerInstance {
  Handler* handler_;

  void init() {

    [8 lines not shown]
DeltaFile
+31-0clang/test/Sema/LifetimeSafety/dangling-field.cpp
+14-0clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+14-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
+6-4clang/lib/Sema/SemaLifetimeSafety.h
+6-3clang/lib/Analysis/LifetimeSafety/Checker.cpp
+7-0clang/include/clang/Basic/DiagnosticGroups.td
+78-72 files not shown
+85-78 files

LLVM/project 1be0268flang/include/flang/Semantics openmp-modifiers.h, flang/lib/Semantics check-omp-structure.cpp openmp-modifiers.cpp

[OpenMP] Preview of auto-generating OpenMP definitions

The components of this commit:
1. Definitions of descriptors that will hold relevant data in LLVM
   and declarations of associated functions.
2. "Auto-generated" enum definitions and descriptor data
3. Changes to flang's modifier verification to use the new data
   instead of the previously hand-coded modifier information.

This does not contain the actual auto-generation infrastructure.
The included descriptors were generated directly from JSON files by
a custom python script.
DeltaFile
+6,582-0llvm/lib/Frontend/OpenMP/OMPDescriptors.cpp
+0-791flang/lib/Semantics/openmp-modifiers.cpp
+277-0llvm/include/llvm/Frontend/OpenMP/OMPDescriptors.h
+136-111flang/include/flang/Semantics/openmp-modifiers.h
+8-25flang/lib/Semantics/check-omp-structure.cpp
+10-19flang/test/Parser/OpenMP/map-modifiers.f90
+7,013-94611 files not shown
+7,034-98317 files

LLVM/project 08396d7clang/docs ReleaseNotes.md, clang/include/clang/Basic ABIVersions.def

[Sparc][clang] make `_Complex` ABI GCC-compatible (#212340)

Modify the ABI of `_Complex` so that it matches GCC for all types,
specifically:

- On SPARC, a `_Complex` value with an integer element type is now
passed and
returned packed into the one or two integer registers it fits in,
matching GCC.
Clang previously passed such a value indirectly and returned it with one
part
  per register. 
  `-fclang-abi-compat=23` restores the previous behavior.

- On SPARC64, a `_Complex char` or `_Complex short` is now
right-justified in its slot in the parameter array, like every other
scalar
narrower than a slot, rather than left-justified the way a small struct
is.

    [14 lines not shown]
DeltaFile
+585-0clang/test/CodeGen/Sparc/sparc-complex-abi.c
+68-15clang/lib/CodeGen/Targets/Sparc.cpp
+11-0clang/docs/ReleaseNotes.md
+6-0clang/include/clang/Basic/ABIVersions.def
+670-154 files

LLVM/project b6a6e31clang/lib/CIR/CodeGen CIRGenStmt.cpp, clang/lib/CodeGen CGStmt.cpp

[CIR]/[OGCG] Fix handling of bool-backed-scoped-enums (#214084)

This patch primarily fixes the case of a scoped enum with a boolean type
in CIR, which we assume is an 'int' type, whereas this one case, that is
not true. Rather than change the Dialect for what amounts to a very rare
case, we've instead opted to just coerce the bool type into a 1 bit int
type, so that all our passes will consider it the same as the rest of
the switches, and not have to special-case the 'bool' types.

AS A DRIVE-BY: I discovered that classic-codegen manages to assert on
llvm::isUIntN in the case where the storage of a range for
GNU-range-switch is less than 7 bits, so bit-int could possibly hit this
too with gnu-range. This patch would fix any case (as the test for the
'shortcut' is for <64).
DeltaFile
+61-0clang/test/CIR/CodeGen/switch.cpp
+18-0clang/test/CodeGen/enum-bool.cpp
+17-0clang/test/CodeGen/ext-int.c
+12-0clang/lib/CIR/CodeGen/CIRGenStmt.cpp
+2-1clang/lib/CodeGen/CGStmt.cpp
+110-15 files

LLVM/project b650fe5clang/lib/Analysis/LifetimeSafety Dataflow.h LoanPropagation.cpp

[clang][LifetimeSafety] Drop block-local origins at block exit (#213530)

Block-local origins were only discarded in `join`, which the dataflow
driver skips when a successor's in-state is seen for the first time, and
therefore always skips for a block with a single predecessor. In
straight-line code the block-local map was inherited down the whole
chain and never cleared, so it accumulated every expression origin in
the region.

Drop them in a new `exitBlock` hook instead, which runs on every edge.
This also keeps in-states canonical, so state comparison no longer sees
a spurious difference between a first-visit in-state and a joined one.

The per-program-point states the checker queries are unaffected; only
the state propagated across block boundaries changes.

LoanPropagation time below, median of 5-7 interleaved runs of a baseline
and a patched binary. Synthetic cases are from
clang/test/Analysis/LifetimeSafety/benchmark.py:

    [26 lines not shown]
DeltaFile
+10-1clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+6-1clang/lib/Analysis/LifetimeSafety/Dataflow.h
+16-22 files

LLVM/project 59de680clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/test/CIR/IR invalid-record-layout.cir

[CIR] Verify record_align is a non-zero power of two (#214074)

`#cir.record_layout` carries `record_align`, which CIRGen fills from
`ASTRecordLayout::getAlignment()` and consumers read as an
`llvm::Align`. That constructor asserts the value is a non-zero power of
two, so hand-written CIR naming any other alignment aborted the tool
rather than reporting a parse error. A zero tripped the non-zero assert
and a 3 tripped the power-of-two one, both inside `llvm::Align` with no
indication of which attribute was at fault.

Verify the field where it is parsed. Values CIRGen emits are already
well-formed, so this only affects hand-written input.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+19-0clang/test/CIR/IR/invalid-record-layout.cir
+7-1clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+26-12 files

LLVM/project af757e5clang/lib/StaticAnalyzer/Checkers LifetimeModeling.cpp, clang/test/Analysis lifetime-bound.cpp

[analyzer] Discard stack frames that are not on the current live stack (#213779)

When a source's stack frame is not live on the current stack the
`UseAfterLifetimeEnd` checker emitted a false positive. Such sources
outlive the returned value, so they are not dangling stack sources. This
led to multiple false positives when I ran the `UseAfterLifetimeEnd`
checker on the LLVM project.

---------

Co-authored-by: isuckatcs <65320245+isuckatcs at users.noreply.github.com>
DeltaFile
+19-0clang/test/Analysis/lifetime-bound.cpp
+8-3clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.cpp
+27-32 files

LLVM/project d803a4allvm/test/CodeGen/AMDGPU llvm.amdgcn.s.buffer.load.ll

[NFC][AMDGPU] Update check lines messed up by merge orders (#214236)
DeltaFile
+41-41llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.buffer.load.ll
+41-411 files

LLVM/project fa8a574clang/include/clang/Basic AttrDocs.td, clang/include/clang/Sema Attr.h

[clang][Sema] Handle alloc_align on all HasFunctionProto declarations (#210871)

Fixes  #122058.

## Overview 

Attribute `alloc_align`'s TableGen subject accepts any declaration
satisfying `HasFunctionProto`, but `AddAllocAlignAttr` unconditionally
casts the declaration to `FunctionDecl` (in
`Sema::AddAllocAlignAttr()`). Since there exist `Decl`'s that have an
underlying `FunctionProtoType` but are not `FunctionDecl` (e.g. function
pointer variables and parameters), the unconditional
`cast<FunctionDecl>` is too narrow and leads to a crash for `Decl`s that
are meant to be compatible with the `alloc_align` attribute.

For example, trying to compile `C` file

```
void *(*allocator)(unsigned long long) __attribute__((alloc_align(1)));

    [125 lines not shown]
DeltaFile
+47-1clang/test/Misc/attr-source-range.cpp
+32-0clang/include/clang/Sema/Attr.h
+13-4clang/include/clang/Basic/AttrDocs.td
+12-0clang/test/Misc/attr-source-range.m
+0-10clang/test/CodeGen/xfail-alloc-align-fn-pointers.cpp
+8-0clang/test/SemaObjC/alloc-align-attr.m
+112-154 files not shown
+129-1810 files

LLVM/project 9629318llvm/lib/Target/AMDGPU SIRegisterInfo.td SIFrameLowering.cpp, llvm/test/CodeGen/AMDGPU amdgpu-spill-cfi-saved-regs.ll

[AMDGPU] Fix Dwarf CFI emission for exec to vcc spills (#213115)
DeltaFile
+154-0llvm/test/CodeGen/AMDGPU/amdgpu-spill-cfi-saved-regs.ll
+8-8llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+3-2llvm/lib/Target/AMDGPU/SIRegisterInfo.td
+165-103 files

LLVM/project a942677flang/lib/Optimizer/Transforms MIFOpConversion.cpp, flang/test/Lower/MIF coarray_dealloc_not_alloc.f90

[flang][MIF] Fix undef reference to a coarray_handle in mif.dealloc_coarray #193157 (#213890)

This PR fixes the behavior reported in issue #193157. The coarray_handle
was only defined if a call to mif.alloc_coarray was present.
If a call to mif.dealloc_coarray was encountered without a prior call to
mif.alloc_coarray, then the coarray_handle was missing, and therefore
llvm.address_of pointed to a non-existent address, which is not allowed.
We now define a coarray_handle that has not been allocated by PRIF for
each coarray variables.
DeltaFile
+32-2flang/lib/Optimizer/Transforms/MIFOpConversion.cpp
+15-0flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90
+47-22 files

LLVM/project 53e7088flang/include/flang/Parser parse-tree.h, flang/lib/Lower/OpenMP Clauses.cpp

[flang][OpenMP] Use 'present-modifier' instead of 'expectation' in 5.1 (#214083)

The 5.1 spec lists PRESENT as an alternative in a 'motion-modifier'. The
other alternatives are mapper and iterator. These already exist as
separate modifiers, so 'motion-modifier' would best be expressed as a
modifier group. While modifier groups are not implemented yet, borrow
'present-modifier' from the 6.0 spec.

The 'expectation' modifier only existed in 5.2, it was replaced by
'present-modifier' in 6.0.
DeltaFile
+44-20flang/lib/Lower/OpenMP/Clauses.cpp
+32-16flang/include/flang/Parser/parse-tree.h
+21-9flang/lib/Parser/openmp-parsers.cpp
+6-3flang/lib/Semantics/openmp-modifiers.cpp
+4-4flang/test/Semantics/OpenMP/to-clause-v45.f90
+4-4flang/test/Semantics/OpenMP/from-clause-v45.f90
+111-562 files not shown
+113-588 files

LLVM/project ae98c7dllvm/test/CodeGen/AMDGPU flat-saddr-atomics.ll llvm.amdgcn.wmma.imm.gfx1250.w32.ll

[AMDGPU][GFX1250] Use null register for global_prefetch_b8 instead of s[0:1] (#214127)
DeltaFile
+250-250llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wmma.gfx1250.w32.ll
+232-232llvm/test/CodeGen/AMDGPU/flat-saddr-load.ll
+196-196llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wmma.imod.gfx1250.w32.ll
+183-183llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
+174-174llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wmma.imm.gfx1250.w32.ll
+166-166llvm/test/CodeGen/AMDGPU/flat-saddr-atomics.ll
+1,201-1,201199 files not shown
+6,331-6,331205 files

LLVM/project d7c8296llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Transforms/InstCombine/AArch64 sve-intrinsic-opts-orr.ll

[InstCombine][AArch64] Combine ORRs with logical umin ops (#213651)

Combine:
  orr(umin(A, 1), umin(B, 1)) -> umin(orr(A, B), 1)

To remove a redundant UMin. This pattern has been observed with
reduction chains of multiple ORRs of UMin(x, 1), where only one final
UMin(x, 1) is necessary for truncation.
DeltaFile
+107-0llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-orr.ll
+22-0llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+129-02 files

LLVM/project 3dec5daclang-tools-extra/clang-tidy/modernize UseDefaultMemberInitCheck.cpp

[clang-tidy][NFC] Apply llvm-type-switch-case-types check (#214017)
DeltaFile
+6-6clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
+6-61 files

LLVM/project 6319001flang/lib/Lower/OpenMP Clauses.cpp

Fix copy/paste error: From -> To
DeltaFile
+3-3flang/lib/Lower/OpenMP/Clauses.cpp
+3-31 files

LLVM/project 904b951llvm/lib/Target/SPIRV SPIRVBuiltins.cpp, llvm/test/CodeGen/SPIRV/transcoding OpGroupAsyncCopy.ll

[SPIR-V] Fix OpGroupAsyncCopy null event substitution (#212754)

Only replace the event operand with OpConstantNull when it is actually a
null constant

This complies with spirv-val expectations
DeltaFile
+20-0llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+4-3llvm/test/CodeGen/SPIRV/transcoding/OpGroupAsyncCopy.ll
+24-32 files

LLVM/project 8bbdc73llvm/test/tools/llvm-profgen lit.local.cfg, llvm/test/tools/llvm-profgen/X86 perf-invocation-error.test perfdata-redirect.test

[llvm-profgen] Harden perf script invocation (#212253)

Harden ``llvm-profgen``'s ``perf script`` invocation for ``--perfdata``:
report launch/exit failures, and clear redirect files between the two
invocations so stale stdout/stderr cannot leak. Cover both with lit
tests that inject a mock ``perf`` via ``PATH``.

Assisted by GPT-5
DeltaFile
+127-0llvm/test/tools/llvm-profgen/X86/perfdata-redirect.test
+62-0llvm/test/tools/llvm-profgen/X86/perf-invocation-error.test
+48-6llvm/tools/llvm-profgen/PerfReader.cpp
+3-0llvm/test/tools/llvm-profgen/lit.local.cfg
+240-64 files

LLVM/project 848d63cllvm/lib/Transforms/Vectorize LoopVectorizationPlanner.h VPlan.cpp

[LV] Fix unintended SCEV cache population when querying UnrollVectorizedLoop (#208500)

LoopVectorize queried getUnrollingPreferences after VPlan execution,
when the vector loop had already been created. If the target hook
queries ScalarEvolution, this populates the SCEV caches with expressions
for the new loop and changes which existing values SCEVExpander reuses
later.

This is exposed by #205102, where the new AArch64 unrolling preferences
cause unrelated LoopVectorize tests to produce different IR.

UnrollVectorizedLoop is a target-wide preference. Query it on the
original loop before VPlan execution and before its SCEV information is
forgotten. This prevents the preference query from polluting subsequent
SCEV expansion.
DeltaFile
+9-1llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+2-4llvm/lib/Transforms/Vectorize/VPlan.cpp
+3-2llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+14-73 files

LLVM/project ee779declang/include/clang/CodeGen CGFunctionInfo.h, clang/lib/CodeGen/Targets Sparc.cpp

[SPARC] use `divideCeil` to calculate register offset (#213739)

So that later arguments get the correct register alignment

https://godbolt.org/z/oaEf4Thvx

On current clang the aligned struct starts in `o1`, but with GCC it is
aligned and starts in `o2`. In practice I think only `float` could hit
this (not an int, not an aggregate, smaller than 64 bits).
DeltaFile
+28-19clang/lib/CodeGen/Targets/Sparc.cpp
+23-0clang/test/CodeGen/Sparc/sparcv9-abi.c
+10-7clang/include/clang/CodeGen/CGFunctionInfo.h
+61-263 files

LLVM/project 27a698bclang/include/clang/Analysis/Analyses/LifetimeSafety Facts.h, clang/include/clang/Basic DiagnosticGroups.td

RAII reseters and dangling field
DeltaFile
+31-0clang/test/Sema/LifetimeSafety/dangling-field.cpp
+14-0clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+14-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
+6-4clang/lib/Sema/SemaLifetimeSafety.h
+6-3clang/lib/Analysis/LifetimeSafety/Checker.cpp
+7-0clang/include/clang/Basic/DiagnosticGroups.td
+78-72 files not shown
+85-78 files

LLVM/project 245c32bclang/include/clang/Analysis/Analyses/LifetimeSafety Facts.h, clang/include/clang/Basic DiagnosticGroups.td

RAII reseters and dangling field
DeltaFile
+31-0clang/test/Sema/LifetimeSafety/dangling-field.cpp
+16-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
+14-0clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+8-4clang/lib/Analysis/LifetimeSafety/Checker.cpp
+6-3clang/lib/Sema/SemaLifetimeSafety.h
+7-0clang/include/clang/Basic/DiagnosticGroups.td
+82-72 files not shown
+89-78 files

LLVM/project a9cc544.github new-prs-labeler.yml

[github] Label llvm/tools/spirv-tools changes as backend:SPIR-V (#214193)

E.g. https://github.com/llvm/llvm-project/pull/214159 PR is missing
labels
DeltaFile
+1-0.github/new-prs-labeler.yml
+1-01 files

LLVM/project 9063da5clang/include/clang/Options FlangOptions.td, clang/lib/Driver/ToolChains Flang.cpp

[flang][flang-rt] Add -ffpe-trap= to set the initial FP exception halting mode (#208828)

Implement the gfortran-style `-ffpe-trap=<list>` option, which sets the
initial floating-point exception halting mode for the main program unit.
The Fortran 2023 standard (17.6) permits the initial halting mode to be
processor defined, so honoring this at program start is conforming.

`<list>` is a comma-separated set of exception mnemonics: `invalid`,
`zero`, `overflow`, `underflow`, and `inexact`, corresponding to the
IEEE_FLAG_TYPE values IEEE_INVALID, IEEE_DIVIDE_BY_ZERO, IEEE_OVERFLOW,
IEEE_UNDERFLOW, and IEEE_INEXACT. As a non-standard, gfortran-compatible
extension, `denormal` halts on the x86 denormal-operand exception. An
empty list or the value `none` disables halting, and the last
`-ffpe-trap=` on the command line wins (allowing an earlier request to
be overridden).

Changes by component:
- clang/Driver: give `-ffpe-trap=` FlangOption/FC1Option visibility and
a one-line HelpText plus a detailed DocBrief (moved into f_Group);

    [28 lines not shown]
DeltaFile
+80-0flang/test/Driver/fpe-trap.f90
+70-0clang/lib/Driver/ToolChains/Flang.cpp
+59-1clang/include/clang/Options/FlangOptions.td
+53-0flang/lib/Frontend/CompilerInvocation.cpp
+38-0flang-rt/test/Driver/fpe-trap-exec-divzero.f90
+33-0flang-rt/test/Driver/fpe-trap-exec.f90
+333-116 files not shown
+591-1322 files

LLVM/project b185b90llvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp, llvm/test/CodeGen/AMDGPU ucmp.ll scmp.ll

AMDGPU/GlobalISel: Legalize G_SCMP and G_UCMP (#213896)
DeltaFile
+1,355-0llvm/test/CodeGen/AMDGPU/scmp.ll
+1,334-0llvm/test/CodeGen/AMDGPU/ucmp.ll
+2-0llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+2,691-03 files

LLVM/project 2fa4508llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 runtime-alias-checks-scheduled-order.ll

[SLP]Fix crash from runtime alias check reusing body scalars

Emit the check at the block's first insertion point instead of before
the terminator. SCEV expansion reuses any dominating instruction, so
at the terminator it could pick up body scalars that are later moved
into the vector block and deleted, causing a crash.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/214211
DeltaFile
+218-0llvm/test/Transforms/SLPVectorizer/AArch64/runtime-alias-checks-scheduled-order.ll
+4-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+222-22 files

LLVM/project 89c4c3cllvm/test/CodeGen/AMDGPU buffer-fat-pointer-atomicrmw-fmin.ll buffer-fat-pointer-atomicrmw-fadd.ll

Merge branch 'main' into users/c8ef/generator
DeltaFile
+3,809-3,814llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmin.ll
+3,809-3,814llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmax.ll
+3,465-3,511llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmin.ll
+3,465-3,511llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmax.ll
+3,299-3,240llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fadd.ll
+2,594-2,524llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmin.ll
+20,441-20,4142,994 files not shown
+178,661-102,9093,000 files

LLVM/project 80e1742llvm/lib/Target/X86 X86ISelLowering.cpp

[X86] Rename getPMOVMSKB -> getMOVMSK (#214177)

The getPMOVMSKB helper has been used to generate MOVMSKPS/D cases as well for some time.
DeltaFile
+17-11llvm/lib/Target/X86/X86ISelLowering.cpp
+17-111 files

LLVM/project 1768978llvm/test/Transforms/LoopVectorize replace-first-order-recurrence-by-versioned-iv.ll induction.ll, llvm/test/Transforms/LoopVectorize/AArch64 conditional-branches-cost.ll induction-costs.ll

[Analysis] Cache generation of SCEV expander overflow checks (#213013)

When creating SCEV checks as part of loop vectorisation we often
generate overflow checks, which leads to lots of duplicated calls to the
umul_with_overflow intrinsic. These calls should be cleaned up during
codegen. However, it is unfortunate that the current LLVM method of
calculating the cost of IR in a block involves looping over each
instruction and adding the costs individually with no thought to the
trivial CSE or DCE optimisations that would take place. In the absence
of a more sophisticated method of cost analysis, for now I've chosen to
explicitly CSE these overflow checks during SCEV expansion.
DeltaFile
+71-81llvm/test/Transforms/LoopVectorize/induction.ll
+17-41llvm/test/Transforms/LoopVectorize/X86/interleave-cost.ll
+14-29llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-cost.ll
+15-16llvm/test/Transforms/LoopVectorize/replace-first-order-recurrence-by-versioned-iv.ll
+12-18llvm/test/Transforms/LoopVectorize/AArch64/induction-costs.ll
+8-20llvm/test/Transforms/LoopVectorize/AArch64/conditional-branches-cost.ll
+137-2058 files not shown
+178-24614 files