Repository navigation
Fix/732 preserve overlap copy semantics - #1417
Merged
Merged
Conversation
cgen overlap-copy changes require updated flowc_stage_a.c and Linux ELF.
Take main bootstrap binary then regenerate for cgen overlap-copy changes.
Sized locals keep bounds checks by default, which skips contiguous memcpy lowering; the region-disjointness proof needs --no-checks.
This was referenced Oct 7, 2026
Closed
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
…om closed PRs Salvaged from closed pull requests whose code already landed: - #1360 (region inference, code merged as #1390): region-inference.md, the tests/cgen region_inference and region_unproven goldens, and the spec, book, spans, lifetime-domains, README, spec-index, nav and CHANGELOG lines. - #1368 (noalias, code merged as #1388): the spans.md paragraph on restrict .data temporaries and its noalias.md link. - #1380 (tail-resumptive effects, code merged as #1349): the spec-index row for effects-continuations.md. #1417 landed after #1360 and keeps an unproven forward copy as an ordered element loop. The region_inference golden and the docs now say that, in place of the memmove the closed branch expected. The golden fails on the pre-#1417 compiler, which emitted memmove.
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
…om closed PRs (#1425) Salvaged from closed #1360 (region-inference.md, region_inference and region_unproven goldens, spec/book/index lines), #1368 (spans.md restrict .data paragraph) and #1380 (spec-index row for effects-continuations.md). The region_inference golden and docs follow #1417: an unproven parameter copy stays an ordered loop.
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
…739) Folded into the rebased feature commit while resolving it against #1417: - Span copies use memcpy through .data only when flowc_region_disjoint proves the regions disjoint; otherwise the ordered loop stays. The branch's memmove path would snapshot a shifted view (dst = src + 1) that the scalar loop treats as a recurrence. - The scale, axpy and add vector_size kernels run only when every read base is the destination itself or proven disjoint from it, the scalar factor reads no memory and calls nothing (it is hoisted), all bases share the element type, and FLOWC_CHECKS is off (the kernels move whole lanes past the per-index bounds tests). - Salvaged from closed #1396 (commit 2eedcac): flowc_cgen_if_is_select returns flowc_cgen_select_exprs_ok, and an if without else is never a select, so `if c { a[i] = v }` no longer reads a[i] when c is the bounds guard (test_hybrid_events, test_stdlib_regex). Tests: for_simd_kernel_overlap (runtime recurrence on shifted views; the branch's original compiler exits 1), for_simd_kernel_disjoint, for_simd_kernel_checked, for_simd_select_noelse, and for_simd_span_copy (parameters keep the loop, disjoint locals memcpy). All of them fail on the branch's original compiler.
8 tasks done
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
#pragma omp simd and GCC ivdep tell the C compiler that iterations are independent. An indexed store does not prove that on its own: dst may be src + 1. A loop body now gets them only when it is one statement that is either a reduction or a store dst[i] = e where the noalias analysis made dst restrict (#731) and e reads dst only at [i]. A reduction whose other operand reads the accumulator (acc = acc + acc * 2) is a recurrence and is no longer treated as a reduction. Other loops keep the clang vectorize request. flowc_cgen_assign_is_index_store is removed as unused. Carried from the SIMD half of the original #1416 branch; its copy half landed as #1417.
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
Counted whiles rotate to a C for with the clang hint and GCC ivdep. Unit-stride span copies use one memcpy through .data when region inference proves the regions disjoint, otherwise the ordered loop stays (#1417). Clip/min-max if/else stores to one index become a ternary select; an if without else keeps the branch (folded from closed #1396). f32/f64 fill/scale/axpy/add/sum/dot use vector_size(16) kernels behind FLOWC_HAS_V128 only when every read base is the destination or proven disjoint, the scalar factor is pure, and FLOWC_CHECKS is off. Goldens: for_simd_kernel_overlap, for_simd_kernel_disjoint, for_simd_kernel_checked, for_simd_select_noelse, for_simd_span_copy, for_simd_while, for_simd_clip. Part of #739.
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
#pragma omp simd and GCC ivdep tell the C compiler that iterations are independent. An indexed store does not prove that on its own: dst may be src + 1. flowc_cgen_loop_omp_safe now accepts a body of `let` statements followed by one statement that is either a reduction whose accumulator no `let` reads, or a store or select `if` into dst[v] where the noalias analysis made dst restrict (#731) and every expression reads dst only as dst[v]. A reduction whose other operand reads the accumulator (acc = acc + acc * 2) is a recurrence and no longer counts. The rotated while loops from #1363 use the same predicate for their ivdep, and flowc_cgen_body_omp_safe_skip is removed. Other loops keep the clang vectorize request. Carried from the SIMD half of the original #1416 branch; its copy half landed as #1417.
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
#pragma omp simd and GCC ivdep tell the C compiler that iterations are independent. An indexed store does not prove that on its own: dst may be src + 1. flowc_cgen_loop_omp_safe now accepts a body of `let` statements followed by one statement that is either a reduction whose accumulator no `let` reads, or a store or select `if` into dst[v] where the noalias analysis made dst restrict (#731) and every expression reads dst only as dst[v]. A reduction whose other operand reads the accumulator (acc = acc + acc * 2) is a recurrence and no longer counts. The rotated while loops from #1363 use the same predicate for their ivdep, and flowc_cgen_body_omp_safe_skip is removed. Other loops keep the clang vectorize request. Carried from the SIMD half of the original #1416 branch; its copy half landed as #1417.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Linked issue or roadmap item:
What changed, and why is this the smallest useful change?
Overlap check
Overlap / dependency notes:
Evidence
Baseline before this change:
Targeted proof that exercises the changed behaviour:
Why that proof would detect the old failure or regression:
Repository gate(s) run:
Generated/bootstrap state, if any:
Risk
Compatibility, performance, security, lifetime, backend, or release implications:
docs/project/Questions.mdupdated if this needs a language-design decision.Compatibility
docs/project/CHANGELOG.md.Agent handoff
Agent/provider/session, when applicable:
Any remaining blocker is recorded in GitHub rather than only in local/session state: