[BOLT][RISCV] Keep instrumentation out of LR/SC functions (#237157)
Counter spills and AMOs can break the eventual-success guarantee of
constrained LR/SC loops. Reservation sequences can cross basic-block
boundaries, and unmatched instructions must be treated conservatively.
Skip instrumentation of functions containing LR/SC instructions,
covering both widths and all ordering variants. Leave ordinary AMOs
instrumentable.
Assisted by GPT-6.
[Clang][OpenMP] Handle loop transforms in SIMD-only mode CodeGen (#238257)
For all loop transforms, Clang cast loop as a `CapturedStmt` in the
`-fopenmp-simd` mode, when these loop transforms keep a normal loop
`ForStmt` and do not wrap a captured region.
This in-turn results in a crash for all loop transforms (verified), as
mentioned for flatten here (#231741).
Note: Only unroll was on the list and not other loop directives.
Fixes #231741
[libc++] Use glibc random APIs for std::random_device on Linux (#222567)
Use arc4random with glibc 2.36 and later, and getentropy with glibc
2.25 through 2.35. Retain current urandom file based implementation
on other Linux libc and older glibc versions.
[flang] Pin -fno-plt tests to supported targets only (#239051)
The fno-plt integration test checks for nonlazybind on the define line
of @test_ by requiring '{' right after the argument list. Some targets,
including AIX and powerpc64le, attach an attribute group to the define
(`#0` before `{`), so that check fails there.
Run fno-plt.f90 with -triple x86_64-unknown-linux-gnu, where the define
has no implied attributes, and require x86-registered-target for it.
Add a REQUIRES line limiting the IR-loading test to x86 and ARM targets,
since those are the targets where -fno-plt is forwarded.
Assisted by Cursor
---------
Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>
RISCV: Use minimal tablegen inputs for TargetParser
Generate RISCVTargetParserDef.inc from a reduced td file which
includes only the features, profiles and processors, instead of all of
RISCV.td. The processors reference scheduling models, which are
defined with the scheduling information for the instructions, so the
new file defines empty placeholder models instead, as was done for
AArch64 in #231954.
RISCV was the last TargetParser input that parsed the full target, and
took 1.74 of the 1.78 seconds spent in the TargetParser tablegen jobs.
llvm-min-tblgen -gen-riscv-target-def, mean of 5 runs
Gigainstructions Seconds Peak RSS .td deps
RISCV.td 7.47 1.74 407 MB 139
RISCVTargetParserDef.td 0.04 0.01 7 MB 9
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RISCV: Define macro fusion features separately from predicates
Move the fusion tuning features to RISCVFeatures.td with the other
tuning features, and attach the predicates with SimpleFusionFor and
FusionFor. The features no longer depend on the instruction definitions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
TableGen: Allow macro fusion predicates for a separate subtarget feature
Fusion defines a subtarget feature and its fusion predicates in a single
record. The predicates reference instructions, so the feature can't be
defined without the instruction definitions. Add FusionFor and
SimpleFusionFor to attach fusion predicates to a SubtargetFeature
defined elsewhere.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
*/R-cran-*: Remove redundant BUILD_DEPENDS
Mk/Uses/cran.mk unconditionally sets NO_BUILD, so nothing runs during
the build phase. The real work, R CMD INSTALL, happens in do-install
when run dependencies have already been installed. Listing R-cran-*
packages in BUILD_DEPENDS, with or without cran:compiles, only installs
these dependencies earlier.
While here:
- math/R-cran-Amelia: move rlang, an Import that was only listed in
BUILD_DEPENDS, to RUN_DEPENDS. Bump PORTREVISION.
- math/R-cran-MatchIt: likewise for rlang; drop chk, which 4.8.1 no
longer imports; bump PORTREVISION.
- textproc/R-cran-openxlsx, textproc/R-cran-readxl: drop knitr from
BUILD_DEPENDS. It is only a vignette builder and CRAN tarballs ship
built vignettes.
Reviewed by: dteske, eduardo, longros, uzsolt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60835
*/R-cran-*: Remove redundant BUILD_DEPENDS
Mk/Uses/cran.mk unconditionally sets NO_BUILD, so nothing runs during
the build phase. The real work, R CMD INSTALL, happens in do-install
when run dependencies have already been installed. Listing R-cran-*
packages in BUILD_DEPENDS, with or without cran:compiles, only installs
these dependencies earlier.
While here:
- math/R-cran-Amelia: move rlang, an Import that was only listed in
BUILD_DEPENDS, to RUN_DEPENDS. Bump PORTREVISION.
- math/R-cran-MatchIt: likewise for rlang; drop chk, which 4.8.1 no
longer imports; bump PORTREVISION.
- textproc/R-cran-openxlsx, textproc/R-cran-readxl: drop knitr from
BUILD_DEPENDS. It is only a vignette builder and CRAN tarballs ship
built vignettes.
Reviewed by: dteske, eduardo, longros, uzsolt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60835
[flang][OpenMP][NFC] Update do concurrent documentation (#238892)
Update `DoConcurrentConversionToOpenMP.md` to reflect the current state
of locality specifier support, and add combinatorial device tests to
verify locality specifier interactions on the GPU offloading path.
The existing documentation was written before locality specifiers were
implemented and described them as future work. This PR updates it to
reflect the current state. It also updates some other parts such as
moving some "Next Steps" to "Implementation notes" because some
so-called next steps have been long completed. For example, dedicated
`fir.do_concurrent` ops, delayed privatization etc).
Co-authored-by: Claude Opus 4 (1M context) <noreply at anthropic.com>
[mlir] Add Diagnostic::getStringArgument for diagnostic-owned strings (#236965)
Diagnostic metadata is a vector of `DiagnosticArgument`, and a string
argument only refers to its text. A caller that stores a non-constant
string in the metadata has to keep it alive itself, which in practice
means
interning it as a `StringAttr`. That takes the context lock and keeps
the
string alive until the context is destroyed.
This adds `Diagnostic::getStringArgument`, which copies a `Twine` into
the
storage the diagnostic already uses for streamed strings and returns an
argument that refers to it. The streaming operators use it as well.
[flang][OpenACC] Diagnose DECLARE directives in procedure lists (#237460)
An OpenACC DECLARE before an external procedure or between procedures
can produce misleading statement-function and end-program diagnostics.
Diagnose it with `OpenACC DECLARE directive must appear in the
specification part of the scope to which it applies` and recover in
program-unit, internal-subprogram, module-subprogram, and interface
lists.
Keep directive recognition and recovery-node construction in
openacc-parsers.cpp, and reuse the existing ErrorRecovery node across
these contexts. At file scope, give complete specification statements
and assignments precedence over procedure headers, preserving unnamed
main programs, keyword-shaped object names, and CUDA ATTRIBUTES
declarations. Reuse the ordinary SUBROUTINE recognizer, including its
malformed-header recovery.
Classify the directive prefix with the same directive grammar used to
consume it, so compiler directives ending at semicolons leave following
[19 lines not shown]
[libc] Use a syscall wrapper for clock_settime (#238738)
This PR move clock_settime behind the centralized syscall wrappers,
following libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for clock_gettime (#238737)
This PR move clock_gettime behind the centralized syscall wrappers,
following libc/docs/dev/syscall_wrapper_refactor.md.
[lld][COFF] Mirror ELF LTO sample profile collection in reproducers (#225026)
Mirror ELF's reproducer behavior by archiving the file named by
/lto-sample-profile and rewriting the option's path in the generated
response file. This lets reproduced links load the profile from the
archive.
[RISCV] Check hasStdExtZba() instead of hasShlAdd(3) before emitting Zba only instructions. (#239031)
hasShlAdd(3) allows Andes and T-Head extensions, but we only emit Zba
shXadd opcodes.
I think this code is only used by vector spill/reload. I don't know if
any Andes or T-Head cores support vector and the extensions in hasShlAdd
without also supporting Zba.
[AMDGPU] Fix MFMA co-exec DS, VMEM, SALU and VALU stages for SMFMAC and DGEMM
getMFMACoExecInfo allowed DS, VMEM, SALU or VALU in the wrong cycles after
these gfx950 MFMAs:
- SMFMAC 16x16 holds VALU until cycle 3, not 2. Split them from the XDL
16x16 entry, which allows VALU from cycle 2.
- SMFMAC 32x32 allows DS, VMEM and VALU from cycle 3, not 4.
- DGEMM 16x16x4 allows DS, VMEM and SALU from cycle 1, not 0.
MI350X issues VALU at cycle 3 after both SMFMAC sizes.
Update the expected stages in GFX950IssueStages.
Assisted-by: Claude Opus 5.5
[AMDGPU] Precommit MFMA co-exec DS, VMEM and SALU stage tests (NFC)
Check the first cycle DS, VMEM and SALU can issue after each MFMA in
GFX950IssueStages. The expectations match the current table, which holds DS
and VMEM one cycle too long after SMFMAC 32x32 and allows DS, VMEM and SALU
one cycle too early after DGEMM 16x16x4.
Assisted-by: Claude Opus 5.5
[AMDGPU] Fix the packed F32 unpack window in SIPreEmitPeephole for gfx950
On gfx950 a v_pk_*_f32 issues at NumPasses + 3 after an XDL, but
collectUnpackingCandidates only unpacked up to NumPasses - 1. Where the
co-execution table holds PK_F32 past VALU, use the gap between their
co-issue cycles as the window.
Add a PK_F32 CoExecMask bit and gfx950 table slots, fitted to MI350X; the
coexec scheduler and hazard recognizer use them too.
MI350X clocks per MFMA plus four v_pk_fma_f32 (six for F8F6F4):
- BF16 16x16x32: 40 -> 36
- F8F6F4 16x16x128: 56 -> 52
Assisted-by: Claude Opus 5.5
[AMDGPU] Precommit SIPreEmitPeephole unpack window tests (NFC)
Add gfx950 cases where packed F32 instructions follow a BF16 XDL2x and an
F8F6F4 XDL2x, and where they follow an XDL2x behind a long S_NOP. The CHECK
lines record what the pass does today.
Assisted-by: Claude Opus 5.5