[flang] Fix FIR AliasAnalysis for zero-offset view chains (#192710)
When subroutine `f` below is inlined, the `ACCImplicitData` pass fails
to recognize that `b` is already covered by the enclosing `!$acc data
deviceptr`. The deviceptr clause operates on a box (`fir.embox` result)
while the inner `acc.serial` uses the underlying ref.
`fir::AliasAnalysis` traces both back through the full def-chain, where
an upstream sliced `fir.embox` (from `a(:,5)`) sets
`approximateSource=true`, causing `MayAlias` instead of `MustAlias`. The
pass falls back to implicit `copyin`/`copyout`, causing a segfault.
```fortran
module test_mod
real, allocatable :: a(:,:)
contains
subroutine f(b)
real, dimension(*) :: b
!$acc data deviceptr(b(1:100))
!$acc serial
[23 lines not shown]
[SSAF] Fix -Wunused-variable in b73ce3e53fcb9f72c759139e93db7e16a813c3b2 (#195944)
There was a variable only used in an assertion in a call to addSummary.
Mark it [[maybe_unused]] given the call has side effects.
[OpenMP][offload] Add cross-team reduction performance test
Tests different patterns of OpenMP cross-team reductions. Should not be
included in regular `ninja check-offload` runs, thus excluded.
[OpenMP][offload] Add cross-team reduction performance test
Tests different patterns of OpenMP cross-team reductions. Should not be
included in regular `ninja check-offload` runs, thus excluded.
[NFC][CIR] Pass StringRef to `getIntrinsicForClangBuiltin` directly (#195458)
`prefix` is already a StringRef, so pass it to
`getIntrinsicForClangBuiltin` and `getIntrinsicForMSBuiltin` directly.
Additionally, drop some redundant `llvm::` and `Intrinsic::` namespace
qualifiers.
[PowerPC] Remove duplicate patterns for atomic_swap
The definition and implementation of atomic_load_* and atomic_swap
is basically similar. Changing the way how the operations are
enumerated makes it possible to remove the separate patterns for
atomic_swap.
[PowerPC] Further refactor atomic loads (#194445)
Depending on the availability of the word-part feature, different code
is generated for 1 and 2 byte atomic loads. This change moves the
decision to use the word-part feature from C++ into TableGen patterns.
This is done via:
- move code from `EmitPartwordAtomicBinary()` into new function
'signExtendOperandIfUnknown()'
- decouple functions `EmitPartwordAtomicBinary()` and
`EmitAtomicBinary()`
- remove the size from the name of the pseudo instructions; instead,
introduce a pseudo instruction which is used in case the word-part
feature is missing
- update the handling of the pseudo instruction insertion accordingly
A side effect of this change is the implementation requires 11 pseudo
instructions less.
[flang] Implement SIMPLE procedure support (parsing, semantics, diagnostics) (#161285)
Implement support for the Fortran 2023 `SIMPLE` procedure specifier.
This change includes:
- Parsing and attribute registration for `SIMPLE` procedures
- Adding `SIMPLE` to procedure characteristics
- Semantic support for `SIMPLE`, including treating `SIMPLE` procedures
as `PURE` (`SIMPLE` implies `PURE`)
- Rejecting `SIMPLE` + `IMPURE` combinations
- Emitting and reading `SIMPLE` in mod files
- Adding parser, semantic, and modfile tests to validate `SIMPLE`
behavior
`SIMPLE` procedures satisfy `PURE` requirements, while `PURE` procedures
do not imply `SIMPLE`.
[LV] Extend test coverage with predicated IVs and FORs. (#195908)
Add coverage to test where the induction phi itself is a live-out, as
well as various tests where we could either generate a predicated IV or
first-order recurrence.
[SSAF][PointerFlow] Add PointerFlow summary and extractor (#188654)
Implement a PointerFlow summary and extractor, which uses
EntityPointerLevel. An assignment is extracted as a pair of
EntityPointerLevels, representing a directed edge.
Edges extracted from assignments form a directed graph
encoding abstract pointer flow information.
rdar://172429193
---------
Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
Co-authored-by: Jan Korous <jkorous at apple.com>
clang: Print effective triple in -ccc-print-bindings (#195914)
Previously this would print the original triple, rather
than the adjusted triple for the tool invocation which I found
confusing.
[LifetimeSafety] Add support for iterator arithmetic (#195442)
This PR adds origin propagation through iterator arithmetic.
It also adds a few tests to check the new behavior.
Closes #190140
[LoopInfo] Remove redundant LLVM_ABI from Loop member functions (#195863)
Remove redundant `LLVM_ABI` from `addStringLoopAttribute` and
`addIntLoopAttribute`.
Addresses post-merge feedback on #194676.
This patch was generated with the help of Claude and reviewed by a
human.
Co-authored-by: Claude Opus 4 (1M context) <noreply at anthropic.com>
clang: Print effective triple in -ccc-print-bindings
Previously this would print the original triple, rather
than the adjusted triple for the tool invocation which I found
confusing.
[clang] Consistently store format specifiers in execution encoding (#195876)
`DecomposePrintfHandler::HandlePrintfSpecifier()` parses the format
string and collects specifiers into `Specs`. In most cases the collected
specifiers are in the execution encoding, but there were to places that
used string literals in "host" encoding.
Change them to use a part of the parsed `StringLiteral` instead so that
`Specs` always contain text in the execution encoding. This is achieved
by adding `getCharacters()` method to `OptionalAmount` class, following
`ConversionSpecifier::getCharacters()`.
This is to make #169803 smaller and is an NFC before that PR lands.