LLVM/project d79ce87flang/docs Extensions.md, flang/lib/Semantics semantics.cpp

[flang][Semantics] Accept multiple initialization of a COMMON block (#218529)

…as a GNU extension

Some compilers accept a named COMMON block variable being redundantly
initialized (via DATA statements or declaration initializers) in more
than one program unit, as a nonstandard extension, so long as every
appearance that initializes the block does so identically: the same
members are initialized to the same values everywhere the block appears.
flang currently rejects this unconditionally as a hard error, whether or
not the appearances agree.

Downgrade this to a portability warning enabled by default (matching the
behavior of the other compilers) when the initializations are
duplicates. A conflicting initialization -- a different value for a
shared member, or a member initialized in one appearance but not another
-- remains a hard error, as it has no defined, portable behavior
(compilers that accept it disagree on which appearance wins). A member
that is only indirectly initialized via an equivalenced object (rather

    [24 lines not shown]
DeltaFile
+217-0flang/test/Semantics/common-block-multiple-init.f90
+151-12flang/lib/Semantics/semantics.cpp
+29-0flang/test/Semantics/common-block-multiple-init-bindc.f90
+28-0flang/test/Lower/common-block-multiple-init.f90
+26-0flang/test/Semantics/common-block-multiple-init-flags.f90
+14-0flang/docs/Extensions.md
+465-123 files not shown
+477-139 files

LLVM/project 9bd8089bolt/include/bolt/Rewrite RewriteInstance.h, bolt/lib/Core Relocation.cpp

[BOLT][RISCV] Handle static IFUNC calls through .iplt (#207733)

Teach BOLT to recognize RISC-V `.iplt` as a PLT-like section and make
the RISC-V `.plt` entry size explicit. Static RISC-V binaries can use
`.iplt` entries together with `R_RISCV_IRELATIVE` relocations for GNU
IFUNC calls, while call sites reference the IFUNC symbol through
`R_RISCV_CALL_PLT`.
DeltaFile
+65-6bolt/lib/Rewrite/RewriteInstance.cpp
+51-0bolt/test/RISCV/ifunc.s
+2-1bolt/include/bolt/Rewrite/RewriteInstance.h
+1-0bolt/lib/Core/Relocation.cpp
+119-74 files

LLVM/project f3ff76fllvm/lib/Transforms/IPO LowerTypeTests.cpp

format

Created using spr 1.3.7
DeltaFile
+6-5llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+6-51 files

LLVM/project b925adellvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Transforms/LowerTypeTests pr37625.ll export-cross-dso-cfi.ll

no .bc

Created using spr 1.3.7
DeltaFile
+18-13llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+3-4llvm/test/Transforms/LowerTypeTests/export-inline.ll
+2-3llvm/test/Transforms/LowerTypeTests/export-cross-dso-cfi.ll
+2-3llvm/test/Transforms/LowerTypeTests/export-bytearray.ll
+2-3llvm/test/Transforms/LowerTypeTests/export-allones.ll
+1-2llvm/test/Transforms/LowerTypeTests/pr37625.ll
+28-289 files not shown
+37-4415 files

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

[AMDGPU] Expose LDS block features to TargetParser (#220717)

Add `FeatureHalfAddressablePhysicalLocalMemory` to
`AMDGPUFrontendVisibleFeatures` so TargetParser carries them in its
per-GPU feature bitset.
DeltaFile
+18-0llvm/unittests/TargetParser/TargetParserTest.cpp
+6-4llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+1-0llvm/lib/Target/AMDGPU/AMDGPU.td
+25-43 files

LLVM/project 907dd67mlir/lib/Dialect/LLVMIR/IR LLVMDialect.cpp, mlir/test/Dialect/LLVMIR constant-folding.mlir

[MLIR][LLVM] Avoid narrowing wide constant shift amounts (#220777)

LLVM::ShlOp::fold() used APInt::getZExtValue() to compare a constant
shift
amount against the operand bit width.

For wide integer constants whose active value exceeds 64 bits, such as
an i128
shift amount of 2^100, getZExtValue() asserts before the fold can
determine
that the shift is out of range.

Compare the APInt directly with the operand bit width using uge()
instead. This
preserves the existing behavior for out-of-range shifts, which are
currently
left unfolded, while avoiding the unsafe narrowing.

Add regression coverage for:

    [4 lines not shown]
DeltaFile
+34-0mlir/test/Dialect/LLVMIR/constant-folding.mlir
+1-2mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+35-22 files

LLVM/project a4eb2ecorc-rt/include/orc-rt-c/support Compiler.h, orc-rt/include/orc-rt/support Compiler.h

[orc-rt] Sink remaining Compiler.h macros into C API header (#220780)

ORC_RT_LIKELY, ORC_RT_UNLIKELY, ORC_RT_WEAK_IMPORT,
ORC_RT_BUILTIN_UNREACHABLE and ORC_RT_UNREACHABLE are useful from C but
were only reachable through the C++ header, so move them to
orc-rt-c/support/Compiler.h.

Rename ORC_RT_EXPORT to ORC_RT_CXX_EXPORT so that both export macros
name their language explicitly. The C++ header is left holding only that
macro. Keep the header separate anyway so that C APIs don't accidentally
use ORC_RT_CXX_EXPORT.

Extend CAPICompileTest.c to use each moved macro from C, with assertions
in CompilerTest.cpp so the behaviour is checked and not just the syntax.
DeltaFile
+12-48orc-rt/include/orc-rt/support/Compiler.h
+52-1orc-rt/include/orc-rt-c/support/Compiler.h
+30-0orc-rt/test/unit/support/CompilerTest.cpp
+20-0orc-rt/test/unit/support/CAPICompileTest.c
+114-494 files

LLVM/project 4be38a0lld/ELF SyntheticSections.cpp EhFrame.cpp, lld/test/ELF eh-frame-negative-pcrel-sdata4.s eh-frame-negative-pcrel-sdata2.s

[ELF] Omit zero-range FDEs from .eh_frame_hdr (#220492)

A zero-sized function (e.g. only `__builtin_unreachable()` in the body
when not using -trap-unreachable) shares its address with the next
function, and its zero-range FDE can win the uniquify step, leaving the
next real function impossible to unwind.

Fix #218124 by dropping FDEs with a zero PC range from the search table.
DeltaFile
+64-0lld/test/ELF/eh-frame-fde-encoding.s
+37-0lld/test/ELF/eh-frame-hdr-zero-range.s
+6-7lld/test/ELF/eh-frame-negative-pcrel-sdata2.s
+10-0lld/ELF/EhFrame.cpp
+2-2lld/test/ELF/eh-frame-negative-pcrel-sdata4.s
+4-0lld/ELF/SyntheticSections.cpp
+123-91 files not shown
+125-97 files

LLVM/project 6334d98llvm/unittests/CodeGen SelectionDAGTestBase.h

[test] fix use after destroy in SelectionDAGTestBase (#220775)

we were capturing the context from the MMI, which was destroyed after
setup
DeltaFile
+4-3llvm/unittests/CodeGen/SelectionDAGTestBase.h
+4-31 files

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

[AMDGPU] Expose the half-addressable LDS feature to TargetParser

Add FeatureHalfAddressablePhysicalLocalMemory to
AMDGPUFrontendVisibleFeatures so TargetParser carries it in its per-GPU
feature bitset, where getLocalMemorySize can read it.

It is listed in FrontendOnlyFeatures, so clang does not serialize it
into the target-feature string: it is a capability implied by the
subtarget, not something a user selects.

Change-Id: I87edf18bbb527fb90e6a8af1144e985024f063f7
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
DeltaFile
+18-0llvm/unittests/TargetParser/TargetParserTest.cpp
+6-4llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+1-0llvm/lib/Target/AMDGPU/AMDGPU.td
+25-43 files

LLVM/project 1fc6419llvm/lib/Transforms/IPO LowerTypeTests.cpp

format

Created using spr 1.3.7
DeltaFile
+4-2llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+4-21 files

LLVM/project c438db1llvm/test/CodeGen/RISCV/rvv fixed-vector-convert-from-arbitrary-fp.ll, llvm/test/Transforms/ConstraintElimination induction-symbolic-start-postinc.ll

fixup

Created using spr 1.3.7
DeltaFile
+626-0llvm/test/Transforms/ConstraintElimination/induction-symbolic-start-postinc.ll
+623-0llvm/test/CodeGen/RISCV/rvv/fixed-vector-convert-from-arbitrary-fp.ll
+0-584offload/libomptarget/OpenMP/Mapping.cpp
+584-0offload/libompaccsupport/Mapping.cpp
+0-573offload/libomptarget/PluginManager.cpp
+573-0offload/libompaccsupport/PluginManager.cpp
+2,406-1,157194 files not shown
+9,833-2,517200 files

LLVM/project ec82d89llvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Transforms/LowerTypeTests export-icall.ll export-inline.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+48-54llvm/test/Transforms/LowerTypeTests/cfi-icall-alias.ll
+0-39llvm/test/Transforms/LowerTypeTests/Inputs/exported-funcs.yaml
+21-10llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+0-29llvm/test/Transforms/LowerTypeTests/Inputs/export-icall.yaml
+17-6llvm/test/Transforms/LowerTypeTests/export-inline.ll
+18-2llvm/test/Transforms/LowerTypeTests/export-icall.ll
+104-14012 files not shown
+222-17218 files

LLVM/project 2dcc6b3llvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Transforms/LowerTypeTests export-icall.ll export-inline.ll

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

Created using spr 1.3.7

[skip ci]
DeltaFile
+48-54llvm/test/Transforms/LowerTypeTests/cfi-icall-alias.ll
+0-39llvm/test/Transforms/LowerTypeTests/Inputs/exported-funcs.yaml
+21-10llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+0-29llvm/test/Transforms/LowerTypeTests/Inputs/export-icall.yaml
+17-6llvm/test/Transforms/LowerTypeTests/export-inline.ll
+18-2llvm/test/Transforms/LowerTypeTests/export-icall.ll
+104-14012 files not shown
+222-17218 files

LLVM/project 61cdb07llvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Transforms/LowerTypeTests export-icall.ll export-inline.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+48-54llvm/test/Transforms/LowerTypeTests/cfi-icall-alias.ll
+0-39llvm/test/Transforms/LowerTypeTests/Inputs/exported-funcs.yaml
+21-10llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+0-29llvm/test/Transforms/LowerTypeTests/Inputs/export-icall.yaml
+17-6llvm/test/Transforms/LowerTypeTests/export-inline.ll
+18-2llvm/test/Transforms/LowerTypeTests/export-icall.ll
+104-14012 files not shown
+222-17218 files

LLVM/project cdb1815llvm/lib/Target/AArch64 AArch64InstrInfo.h AArch64InstrInfo.cpp

[AArch64][NFC] Make insertion of CMP for fused cond. branches reusable (#220771)

Both if-conversion and CCMP-chain forming need to undo the fusion of
conditional branches such as CBZ or CB.<cc>. With the introduction of
FEAT_CMPBR, this logic got quite involved.

This patch makes the functionality reusable through AArch64InstrInfo.
DeltaFile
+207-201llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+8-0llvm/lib/Target/AArch64/AArch64InstrInfo.h
+215-2012 files

LLVM/project d4aa63ellvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Transforms/LowerTypeTests export-icall.ll export-inline.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+48-54llvm/test/Transforms/LowerTypeTests/cfi-icall-alias.ll
+0-39llvm/test/Transforms/LowerTypeTests/Inputs/exported-funcs.yaml
+21-10llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+0-29llvm/test/Transforms/LowerTypeTests/Inputs/export-icall.yaml
+17-6llvm/test/Transforms/LowerTypeTests/export-inline.ll
+18-2llvm/test/Transforms/LowerTypeTests/export-icall.ll
+104-14012 files not shown
+222-17218 files

LLVM/project a4f8918llvm/include/llvm InitializePasses.h, llvm/lib/CodeGen CodeGen.cpp RegAllocPBQP.cpp

Initialize PBQP Pass for Clang (#217954)

As mentioned in discussion on
https://github.com/llvm/llvm-project/issues/16391, the PBQP allocator is
not available to clang despite existing in the backend. This updates
code to initialize the pass and make it available to clang.
DeltaFile
+13-0llvm/lib/CodeGen/RegAllocPBQP.cpp
+1-0llvm/lib/CodeGen/CodeGen.cpp
+1-0llvm/include/llvm/InitializePasses.h
+15-03 files

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

[SLP] Fix-up profile metadata for runtime alias checks (#220769)

This makes two main changes
* Adds profile information regardless of whether or not the function is
profile. This data is still useful even when little else is profiled.
e.g., it helps ensure that registers are spilt in the cold block rather
than the hot one.
* Switches to using MDBuilder's branch weight designations. The named
values make the meaning of the code clearer and this is the standard way
to denote cold code in the compiler absent additional information about
the specific frequency here.
DeltaFile
+7-4llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+6-3llvm/test/Transforms/SLPVectorizer/X86/runtime-alias-checks.ll
+5-2llvm/test/Transforms/SLPVectorizer/AArch64/runtime-alias-checks-scheduled-order.ll
+18-93 files

LLVM/project 038b4cdflang/include/flang/Support Fortran-features.h, flang/lib/Semantics check-call.cpp

[flang] Warn when an INTENT(IN) dummy is passed to a dummy with no INTENT (#220667)

F'2023 8.5.10 paragraph 2 requires that a nonpointer INTENT(IN) dummy
argument "shall neither be defined nor become undefined during the
invocation and execution of the procedure". A program can violate that
requirement without any diagnostic today by passing the INTENT(IN) dummy
argument on as an actual argument to a procedure whose corresponding
dummy argument has no INTENT attribute: that callee is free to define
its dummy argument, and since #207732 flang propagates INTENT(IN) to
LLVM as `readonly`, so the optimizer is entitled to assume the
definition never happens. The observable result is a program whose
answers change with the optimization level, with nothing pointing at the
cause.

```fortran
program main
  integer :: kk = 1
  call s(kk)
  print *, kk     ! 1 at -O1, 3 at -O2

    [28 lines not shown]
DeltaFile
+60-0flang/test/Semantics/call49.f90
+19-0flang/lib/Semantics/check-call.cpp
+1-1flang/include/flang/Support/Fortran-features.h
+80-13 files

LLVM/project 46f0d85llvm/test/CodeGen/AMDGPU minimumnum.bf16.ll amdgcn.bitcast.128bit.ll

[AMDGPU] Fix for GFX11 VOPD interlock hazard
DeltaFile
+4,397-4,259llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+2,949-2,991llvm/test/CodeGen/AMDGPU/bf16.ll
+2,693-2,610llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+1,297-1,271llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.256bit.ll
+553-553llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.128bit.ll
+425-431llvm/test/CodeGen/AMDGPU/minimumnum.bf16.ll
+12,314-12,11585 files not shown
+15,796-15,31491 files

LLVM/project a8bf25cflang/include/flang/Optimizer/Transforms Passes.td, flang/lib/Optimizer/Transforms SimplifyRegionLite.cpp

[flang][NFC] Allow simplify-region-lite to run on any op (#220698)

The pass only walks the regions of getOperation(). Pinning it to
ModuleOp forced a single liveness lattice over the whole compile unit
and blocked scheduling it under a nested pass manager. Drop the
ModuleOp constraint so callers can run it per IsolatedFromAbove op.
Existing module-level addPass() uses are unchanged.
DeltaFile
+3-5flang/lib/Optimizer/Transforms/SimplifyRegionLite.cpp
+1-1flang/include/flang/Optimizer/Transforms/Passes.td
+4-62 files

LLVM/project 3e9019ellvm/test/Transforms/LoopVectorize div-exact.ll if-pred-stores.ll, llvm/test/Transforms/LoopVectorize/VPlan dissolve-replicate-regions.ll

[VPlan] Skip branch term in masks for some preserved uniform edges
DeltaFile
+28-2,414llvm/test/Transforms/LoopVectorize/predicator.ll
+6-425llvm/test/Transforms/LoopVectorize/X86/cost-conditional-branches.ll
+27-120llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
+16-130llvm/test/Transforms/LoopVectorize/div-exact.ll
+32-93llvm/test/Transforms/LoopVectorize/X86/predicated-replicate-feeding-cast.ll
+25-76llvm/test/Transforms/LoopVectorize/VPlan/dissolve-replicate-regions.ll
+134-3,25833 files not shown
+560-3,83839 files

LLVM/project 74c6569llvm/include/llvm/CodeGen BasicTTIImpl.h

[TTI] Fix dyn_cast null-check in BasicTTIImpl (#220755)

Introduced in #107273.
DeltaFile
+1-1llvm/include/llvm/CodeGen/BasicTTIImpl.h
+1-11 files

LLVM/project 6909103offload/libompaccsupport device.cpp PluginManager.cpp, offload/libomptarget device.cpp PluginManager.cpp

[offload][nfc] Extract libomptarget infrastructure into libompaccsupport (#213784)

libompaccsupport will become the support library for both OpenMP and
OpenACC. This patch extracts the files that will become part of it.
Currently it only moves the files and the build configuration is
unchanged.

Next patches will start refactoring libompaccsupport to flesh out the
subset of the infrastructure that will be shared between OpenMP and
OpenACC in small verifiable chunks while maintaining libomptarget's
existing behaviour.

Gradually adding the libacctarget implementation that uses
libompaccsupport will also follow.
DeltaFile
+0-584offload/libomptarget/OpenMP/Mapping.cpp
+584-0offload/libompaccsupport/Mapping.cpp
+0-573offload/libomptarget/PluginManager.cpp
+573-0offload/libompaccsupport/PluginManager.cpp
+0-513offload/libomptarget/device.cpp
+512-0offload/libompaccsupport/device.cpp
+1,669-1,6703 files not shown
+1,728-1,7289 files

LLVM/project 44bf667llvm/test/Transforms/LoopVectorize div-exact.ll if-pred-stores.ll, llvm/test/Transforms/LoopVectorize/AArch64 conditional-branches-cost.ll

[VPlan] Skip branch term in masks for some preserved uniform edges
DeltaFile
+28-2,414llvm/test/Transforms/LoopVectorize/predicator.ll
+6-425llvm/test/Transforms/LoopVectorize/X86/cost-conditional-branches.ll
+27-120llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
+16-130llvm/test/Transforms/LoopVectorize/div-exact.ll
+32-93llvm/test/Transforms/LoopVectorize/X86/predicated-replicate-feeding-cast.ll
+102-9llvm/test/Transforms/LoopVectorize/AArch64/conditional-branches-cost.ll
+211-3,19134 files not shown
+662-3,84740 files

LLVM/project 4be4f10llvm/lib/Transforms/Vectorize VPlanPredicator.cpp, llvm/test/Transforms/LoopVectorize hoist-predicated-loads.ll if-pred-stores.ll

[VPlan][Predicator] Preserve some uniform control flow

Implements "Partial Control-Flow Linearization" by Simon Moll and
Sebastian Hack.

That should allow implementation of an alternative to
https://github.com/llvm/llvm-project/pull/141900 based on this
functionality (see BOSCC in the paper).
DeltaFile
+1,514-204llvm/test/Transforms/LoopVectorize/VPlan/predicator.ll
+1,492-137llvm/test/Transforms/LoopVectorize/predicator.ll
+184-128llvm/test/Transforms/LoopVectorize/X86/cost-conditional-branches.ll
+236-18llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
+81-45llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
+102-10llvm/test/Transforms/LoopVectorize/hoist-predicated-loads.ll
+3,609-54240 files not shown
+4,300-80046 files

LLVM/project 30b8641llvm/lib/Transforms/Vectorize VPlanPredicator.cpp

Implement non-uniform part of partial linearization algorithm
DeltaFile
+57-12llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
+57-121 files

LLVM/project d29de05llvm/lib/Transforms/Vectorize VPlanRecipes.cpp

Don't crash dumping malformed phis
DeltaFile
+20-0llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+20-01 files

LLVM/project 7006cafllvm/lib/Transforms/Vectorize VPlanPredicator.cpp

[AI] Move convertPhisToBlends to post-linearization
DeltaFile
+28-9llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
+28-91 files