[SSAF][WPA] Operator new/delete overload entities that shall retain their types
A follow-up change to #206600. This commit adds the WPA
implementation for those operator new/delete overload entities that
shall retain their types. This WPA result will later be used to
filter unsafe buffer analysis results.
rdar://179151541
[flang][cuda] Switch CUFAllocDelay to operate on fir.declare (#208334)
CUFAllocDelay previously matched hlfir.declare, requiring it to run
before HLFIR-to-FIR lowering. Match fir.declare instead so the pass can
be scheduled with the other CUF preparation passes (which also operate
on fir.declare), before cuf.alloc is lowered. The delay logic is
unchanged.
[ConstraintEli] Add more tests with latch guarded loops+overflows (NFC) (#208328)
Add additional tests with latch controlled loops and cases where we
currently bail out due to constraint-system overflows.
[clang] add triple to `test/SemaCXX/deduced-return-type-cxx14.cpp`
Fixes issue reported here: https://github.com/llvm/llvm-project/pull/208285#issuecomment-4919717057
Since that test file now uses the `cdecl` attribute, which is not supported
in some targets, pin that test to x86_64 triple.
[DirectX] Expand {u,s}mul.with.overflow in DXILIntrinsicExpansion (#207297)
DXIL has no op for the llvm.{u,s}mul.with.overflow intrinsics. These can
be emulated by performing the full multiply using double-width values
and then checking the high-part of the result. However, this should be
avoided for 32-bit values since we don't want to make the shader start
using 64-bit values if it wasn't before. In this case we can use the
UMul and IMul DXIL operations that return the result as separate low &
high values.
Wider (64-bit) multiplies, which can't widen further, compute the high
half with same-width arithmetic instead.
Fixes #207090
---------
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
Co-authored-by: Farzon Lotfi <farzonl at gmail.com>
[clang][docs] Fix coro_await_elidable bullet list rendering
Add the blank line required before the reStructuredText bullet list and indent the continuation line for the second item. Without this, the generated AttributeReference page does not render the coro_await_elidable safe-elide-context bullets correctly.
Revert "[Clang] support friend declarations with a dependent nested-name-specifier" (#208302)
Reverts llvm/llvm-project#191268
---
Revert dependent friend support due to a crash in access checking
https://github.com/llvm/llvm-project/issues/208290
[flang][OpenACC] Fix host fallback for acc.atomic.update (#207597)
The host fallback for `acc.atomic.update` only processed the first
operation in the region and used its result for the store, ignoring the
remaining operations and the `acc.yield` terminator. This generated
invalid IR when the region contained multiple operations.
1.Fix this by cloning all operations in the region and using the operand
of `acc.yield` as the final result to store.
2.Add tests for atomic read, write, update, and capture operations to
cover the host fallback path.
---------
Co-authored-by: ES3Q <ES3Q at QQ.COM>
[VPlan] Model initial header mask as region value. (#196199)
Introduce a new VPRegionValue for the header mask, managed by loop
regions similar to the canonical IV.
The main benefit is we do not need to materialize the mask early and it
is trivial to find (no more need for patterns hard-coded in findHeaderMask).
It is currently materialized before computing costs, as we compute costs
for part of it currently.
PR: https://github.com/llvm/llvm-project/pull/196199
[PowerPC] Use INT64_MAX instead of LONG_MAX. (#208249)
The value of LONG_MAX is dependent on the host environment used to build
the compiler. For example, X86-64 Windows has a different value than
X86-64 Linux. Using LONG_MAX would give inconsistent results when cross
compiling.
[docs] Enable colon_fence myst extension, fix admonitions (#208322)
The colon_fence myst extension enables triple-colon fences for
admonitions, as in:
:::{note}
**Regular** _markdown_ text, not code.
:::
Using triple colon fences for admonition blocks helps markdown editors
treat the body as markdown text, rather than fixed-width code with a
syntax highlight.
This change fixes a live doc bug in MyFirstTypoFix.md, which uses this
admonition style:
https://llvm.org/docs/MyFirstTypoFix.html
Currently ":::{note} The code changes presented" leaks through in the
HTML, and this one line change fixes it.
[BOLT] Register PIE indirect goto relocations (#206819)
PIE binaries use R_*_RELATIVE dynamic relocations for indirect goto jump
tables. BOLT creates entry points for their targets but does not mark
these addresses as targets from data relocations, so indirect jumps with
unknown control flow (which originates from indirect goto) have no CFG
successors and are interpreted as potential tail calls, while the jump
targets are incorrectly identified as additional entry points.
Add these offsets to the function's list of non-entry relocation
references instead of marking them as entry points. Extend relocation
rewriting to also check whether a block is externally referenced. This
mirrors behavior of data-to-code relocations in non-pie binaries.
[mlir][acc] Add acc.on_device op (#208096)
Add an operation to represent the runtime call to acc_on_device.
This runtime call is important to fold early in the compilation pipeline
and having an operation allows us to easily recognize it when emitted by
frontends.
[SimpleLoopUnswitch] Don't latch-redirect trivial unswitch across convergent ops (#207047)
The trivial-unswitch case added in #204934 can redirect a loop-invariant
branch's latch edge to the loop exit, turning it into an exit branch
that then gets hoisted to the preheader. That changes how many
iterations (and, on GPUs, which lanes) execute the loop body.
When the loop contains a convergent operation that runs each iteration,
hoisting the branch lets one (possibly non-uniform) path bypass the loop
entirely and skip the convergent op. Concretely, this miscompiles an
AMDGPU warp reduction (llvm.amdgcn.update.dpp): lanes drop out of the
cross-lane shuffle, so block reductions come back with partial results.
Guard the new latch-redirect transform with the same convergent /
cross-block-token check that isSafeForNonTrivialUnswitching already
applies (refactored into a shared loopContainsConvergentOrTokenOp
helper). Adds a target-independent lit test that fails before this
change and passes after.
Co-authored-by: Claude Opus
[bazel] Correct config.h definitions for musl (#207295)
The Bazel overlay encodes several configure-time config.h results
manually. It currently treats all Linux platforms as having
execinfo.h/backtrace() and mallinfo(). That matches glibc, but is false
when the build is configured for musl libc.
The upstream .bazelrc provides --config=hermetic-toolchain. A musl build
can be selected by pairing that with the platform labels from the
external Bazel module named llvm, for example:
bazel build --config=hermetic-toolchain \
--platforms=@llvm//platforms:linux_x86_64_musl \
--extra_execution_platforms=@llvm//toolchain:linux_x86_64_platform \
@llvm-project//llvm:not
Only define HAVE_BACKTRACE/BACKTRACE_HEADER when not targeting musl, and
only define HAVE_MALLINFO for GNU libc. With the old definitions, this
fails in LLVM Support, e.g.:
[5 lines not shown]