Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison of branch: master+RAI #47

Closed
wants to merge 126 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
8f76c69
minor refactoring on `find_method_matches` (#53741)
aviatesk Mar 19, 2024
2775c9a
Fix handling of virtual exit node in `PostDomTree` (#53739)
topolarity Mar 19, 2024
9df47f2
post-opt: add more test cases for `visit_conditional_successors` (#53…
aviatesk Mar 19, 2024
5c891de
Remove some duplicates from emitted compilation traces (#53774)
kpamnany Mar 19, 2024
1c2b9ad
compileall: Print error on failure (#53770)
Keno Mar 20, 2024
cc27a7b
Add two missing whitespaces to error messages (#53782)
fingolfin Mar 20, 2024
e0bb95a
small changes to make Base more statically compileable (#53778)
JeffBezanson Mar 20, 2024
bc7ba3d
compiler: Refactor `concrete_eval_invoke` (#53771)
Keno Mar 20, 2024
a30feec
Update LICENSE.md - update copyright years (#53758)
gitboy16 Mar 20, 2024
55afecc
Printf: don't zero pad Inf or NaN (#53785)
jmkuhn Mar 20, 2024
72b1c9e
Document LazyString in performance tips (#53779)
lassepe Mar 21, 2024
8e8b533
minor followups on recent `CodeInstance` refactors (#53581)
aviatesk Mar 21, 2024
09400e4
Switch LLVM codegen of Ptr{T} to an actual pointer type. (#53687)
maleadt Mar 21, 2024
52fc796
Add missing GC_POP() in emit_cfunction (#53809)
gbaraldi Mar 22, 2024
6c22dfd
Remove fl_julia_current_{file, line} (#53797)
Keno Mar 22, 2024
9145571
Use jl_filename/jl_lineno less (#53799)
Keno Mar 22, 2024
3e37e17
also check that UUID of project is non-null when treating it as a pac…
KristofferC Mar 22, 2024
9291845
precompilepkgs: simplify custom config printing if only one (#53805)
IanButterworth Mar 22, 2024
d68a04e
Revert "small changes to make Base more statically compileable" (#53808)
IanButterworth Mar 22, 2024
5ed51d3
Bump libuv (#53822)
Keno Mar 23, 2024
6172020
reland "small changes to make Base more statically compileable (#5377…
JeffBezanson Mar 23, 2024
63e365f
REPL: Expand macros before looking for `using` statements (#53821)
Keno Mar 23, 2024
243f67d
Add docstring for Base.Sort.SMALL_ALGORITHM (#53807)
danik292 Mar 23, 2024
9bd7343
Retry downloads in toml tests (#53828)
IanButterworth Mar 23, 2024
4a2c593
add code loading + precompilation support for workspaces (#53653)
KristofferC Mar 23, 2024
9636ef7
create phantom task for GC threads (#53815)
d-netto Mar 25, 2024
944f180
Add Xoshiro reference to Random module docstring (#53784)
bkamins Mar 25, 2024
61caaa8
update MPFR to 4.2.1 (#53837)
fxcoudert Mar 25, 2024
cd523fe
Update nghttp2 to 1.60.0 (#53842)
fxcoudert Mar 26, 2024
324e353
Update patchelf to 0.18.0 (#53845)
fxcoudert Mar 26, 2024
bf9079a
update PCRE2 to 10.43.0 (#53838)
fxcoudert Mar 26, 2024
018152f
Update zlib to 1.3.1 (#53841)
fxcoudert Mar 26, 2024
4607d53
lowering: Don't bother rewrapping bare linenumbers in hygienic-scope …
Keno Mar 26, 2024
86a697c
🤖 [master] Bump the Pkg stdlib from 6859d6857 to 162634c56 (#53846)
DilumAluthgeBot Mar 26, 2024
64de065
Update libgit2 to 1.8.0 (#53840)
fxcoudert Mar 26, 2024
653c0ae
precompilepkgs: don't confuse single package in project with requesti…
IanButterworth Mar 26, 2024
fc2d3af
precompilepkgs: fix error reporting (#53862)
IanButterworth Mar 27, 2024
d4d34b9
chore: fix some comments (#53861)
crazeteam Mar 27, 2024
6737a1d
Update SuiteSparse to 7.6.1 (#53864)
fxcoudert Mar 27, 2024
f413b01
Remove duplicate small integer union constants (#53866)
LilithHafner Mar 27, 2024
7a62dff
Harmonize and add docs for `--math-mode` (#53818)
sjkelly Mar 27, 2024
a3616a8
Print more info when backtrace test fails (#53874)
Keno Mar 27, 2024
0e2409a
inference: Fix handling of :throw_undef_if_not (#53875)
Keno Mar 27, 2024
bb3b09d
add invokelatest to on_done callback in bracketed paste (#53696)
JeffBezanson Mar 27, 2024
f4866b7
Update p7zip to 17.05 (#53863)
fxcoudert Mar 27, 2024
4ee1022
opaque_closure: Lookup optimized oc source inside code instance (#53878)
Keno Mar 27, 2024
e07c0f1
inference: Fix correctness and ensure termination in the presence of …
Keno Mar 28, 2024
2a944fa
RNG reproducibility discussion - rm confusing ref to MenneTwister (#5…
stevengj Mar 28, 2024
6f51966
Improve error message when source length is wrong in reshape (#53883)
LilithHafner Mar 28, 2024
89d59a9
optimize: Delete incoming unreachable edges from PhiNode (#53877)
Keno Mar 28, 2024
3530c8f
Consistently format Julia in the docstring for Base.DEPOT_PATH (#53873)
Sbozzolo Mar 28, 2024
1e50a99
Utilize bitshifts correctly in signals-mach.c when storing/reading th…
gbaraldi Mar 28, 2024
b18d2cc
use flisp cprimitives for lowering large longs (#53860)
mbauman Mar 28, 2024
a3438d0
fix `NoMethodError` of `changed_lineinfo` (#53890)
aviatesk Mar 29, 2024
11517f2
fix typos in codegen.cpp (#53888)
aviatesk Mar 29, 2024
b2e8eb2
Revert change to checksum for llvm-julia (#53870)
Zentrik Mar 29, 2024
09b356f
fix relocatable upgrades test (#53889)
IanButterworth Mar 29, 2024
e26d140
add initial support for OpenBSD (#53633)
semarie Mar 29, 2024
d10a0fb
curl: fix RPATH to find nghttp2 and libssh2 (#53894)
fxcoudert Mar 29, 2024
24ff6f4
no need to check whether mq_master is nil in the GC work-stealing loo…
d-netto Mar 30, 2024
313f933
curl: remove patch (#53892)
fxcoudert Mar 30, 2024
a3f710e
Copy for `CartesianIndices`/`LinearIndices` need not materialize (#53…
jishnub Mar 31, 2024
e9d25ca
Add `Base.isrelocatable(pkg)` (#53906)
fatteneder Apr 1, 2024
657ce04
Fix calling LLVM_SIZE on windows (#53902)
Zentrik Apr 1, 2024
1fedcab
optimizer: allow multiple inlining again (#53911)
aviatesk Apr 1, 2024
0ac60b7
More emoji completions! 🫠 (#53913)
fonsp Apr 1, 2024
718b988
documentation followup for "invert linetable representation (#52415)"…
aviatesk Apr 2, 2024
d8d3842
Avoid repeated precompilation when loading from non-relocatable cache…
fatteneder Apr 2, 2024
e99627f
Explicitly call out reverse ranges in `:` and `range` docstring (#53626)
BioTurboNick Apr 2, 2024
b70e1ae
Buildkite typos in tests/buildkitetestjson.jl etc fixed
pda Apr 2, 2024
1256e3e
Buildkite Test Analytics: fix failure_expanded
pda Mar 12, 2024
94f887b
note that REPL doesn't show "nothing" values (#53930)
stevengj Apr 3, 2024
854170a
minor followups on the linetable changes (#53921)
aviatesk Apr 3, 2024
a69aa30
oc: code_typed support for optimized opaque closures (#53929)
Keno Apr 3, 2024
c749147
fix typo in comment (#53936)
crazehang Apr 3, 2024
d7dc9a8
make @fastmath mirror how lowering applies literal_pow (#53819)
KlausC Apr 3, 2024
12c9391
“Fix” #53451 -- allow zero-row QR factorization bypassing LAPACK (#53…
manuelbb-upb Apr 3, 2024
286e339
fix macros `@which`, `@edit`, `@functionloc`, `@less` for `literal_po…
KlausC Apr 3, 2024
19919b7
Use `copyto!` in converting `Diagonal`/`Bidiagonal`/`Tridiagonal` to …
jishnub Apr 4, 2024
cb4e107
Add `zero` for `Base.TwicePrecision` (#53787)
jishnub Apr 4, 2024
0cd3164
Update stable version in README.md (#53947)
jishnub Apr 4, 2024
19fffe1
Fixes for allowing `:throw_undef_if_not` on the frontend (#53944)
Pangoraw Apr 4, 2024
c371e4c
Fix negative tolerance documentation issue in cholesky.jl (#53918)
mestinso Apr 4, 2024
66a4fa7
Buildkite Test Analytics: fix `failure_expanded` (#53706)
vchuravy Apr 4, 2024
a931fbe
Make all command-line options documented in all related files (#53826)
prbzrg Apr 4, 2024
e64fa86
Add missing methods for UniformScaling (#53949)
jishnub Apr 5, 2024
57bbff6
Profile: make heap snapshots viewable in vscode viewer (#53833)
IanButterworth Apr 5, 2024
6ea67a9
change the variable name `linfo::MethodInstance` to `mi::MethodInstan…
aviatesk Apr 5, 2024
5f4dec1
make loading work with a `entryfile` entry in the manifest file (#53939)
KristofferC Apr 5, 2024
d505c8c
`LazyString` in `LinearAlgebra.checksquare` error message (#53961)
jishnub Apr 5, 2024
0e59c9e
Use StringMemory instead of StringVector where possible (#53962)
Zentrik Apr 5, 2024
59c3c71
TOML: Improve type-stability of BigInt/UInt support (#53955)
topolarity Apr 5, 2024
d963a34
profile: doc: update the `Allocs.@profile` doc string (#53825)
nsajko Apr 5, 2024
c707a53
Explicit namespaces in sort-related docstrings (#53968)
jishnub Apr 6, 2024
273d91e
Make reshape and view on Memory produce Arrays and delete wrap (#53896)
LilithHafner Apr 6, 2024
f7c7410
`LazyString` in `DimensionMismatch` error messages in broadcasting (#…
jishnub Apr 6, 2024
4e5bd66
fix minor typo in mktempdir docs (#53977)
musoke Apr 6, 2024
821c608
Fix #52989: DateTime parser would return an error when parsing a year…
Viriato5 Apr 6, 2024
1febcd6
Fix typos in docstrings (#53986)
lanceXwq Apr 7, 2024
243ebc3
Support broadcasting over structured block matrices (#53909)
jishnub Apr 7, 2024
c5a3b65
Remove trailing slash in "Official https://julialang.org/ release" (#…
LilithHafner Apr 7, 2024
e4f2124
Test and fix non-int-length bug in `view(::Memory, ::Union{UnitRange,…
LilithHafner Apr 8, 2024
62df400
inference: fixes cache lookup with extended lattice elements
aviatesk Apr 4, 2024
41347f5
🤖 [master] Bump the StyledStrings stdlib from e0ca0f8 to bfdb4c3
DilumAluthge Apr 8, 2024
a5356a4
optimize construction of `InferenceResult` for constant inference
aviatesk Apr 4, 2024
0e28cf6
inference: fixes cache lookup with extended lattice elements (#53953)
aviatesk Apr 8, 2024
3988860
Bump the StyledStrings stdlib from e0ca0f8 to bfdb4c3 (#53993)
tecosaur Apr 9, 2024
26070ca
irinterp: Don't try to access mi.def if it's not a Method (#54003)
Keno Apr 9, 2024
7099bdd
LinearAlgebra: LazyString in interpolated error messages (#53976)
jishnub Apr 9, 2024
97ac3ec
make `view(::Memory, ::Colon)` produce a Vector (#54005)
LilithHafner Apr 9, 2024
f870ea0
Correct return types in docstrings of sincos* (#54006)
moble Apr 9, 2024
d183ee1
Improve performance of `ncodeunits(::Char)` (#54001)
Seelengrab Apr 9, 2024
e9a24d4
🤖 [master] Bump the Pkg stdlib from 162634c56 to 8f772ffa7 (#54018)
DilumAluthgeBot Apr 10, 2024
f46cb4c
allow extensions to trigger from packages in [deps] (#54009)
KristofferC Apr 10, 2024
3357d1b
revert moving "creating packages" from Pkg.jl (#53509)
KristofferC Apr 10, 2024
45fb084
inlining: remove unused `allow_abstract::Bool` keyword argument (#53601)
aviatesk Apr 10, 2024
630f754
Fix comparison base for line table compression (#54032)
Keno Apr 11, 2024
dc8857a
ir: Add version of compute_trycatch for IRCode (#54035)
Keno Apr 11, 2024
a7fd6a7
Allow mutable-for-identity-only types to be inlined into IR (#54034)
Keno Apr 11, 2024
f085913
constprop: Add facility for widening arguments before constprop (#54036)
Keno Apr 11, 2024
db247ce
LinearAlgebra: Remove unnecessary adjoint/transpose for bidiag/tridia…
jishnub Apr 11, 2024
6e5c4e9
RAI: Change task ordering behavior to prioritize older tasks
kpamnany Aug 9, 2023
e322667
Add PR template and labels (#62)
nickrobinson251 Sep 20, 2023
878f6a4
Add heartbeat capability
kpamnany Oct 7, 2023
ee2831c
Change heartbeat thread controls
kpamnany Nov 12, 2023
18c0aa9
Add GitHub template and workflows needed on the default branch (#136)
Drvi Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# See https://github.com/actions/labeler
port-to-master: '**'
port-to-v1.10: '**'
port-to-v1.9: '**'
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!---
PRs to RelationalAI/julia must be opened to the correct branch (see
https://github.com/RelationalAI/raicode/blob/master/nix/julia-version.json).
-->
## PR Description

_What does this PR do?_

## Checklist

Requirements for merging:
- [ ] I have opened an issue or PR upstream on JuliaLang/julia: <link to JuliaLang/julia>
- [ ] I have removed the `port-to-*` labels that don't apply.
- [ ] I have opened a PR on raicode to test these changes: <link to raicode>
17 changes: 17 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://github.com/actions/labeler
name: "Pull Request Labeler"
on:
pull_request_target:
types:
- opened

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
dot: true
16 changes: 16 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Close stale PRs"
on:
schedule:
- cron: "0 0 * * *" # every night at midnight

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Comment or remove stale label, or this PR will be closed in 5 days.'
days-before-stale: 30
days-before-close: 5
stale-pr-label: 'stale'
29 changes: 29 additions & 0 deletions .github/workflows/update-upstream-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Update upstream branches"
on:
schedule:
- cron: "0 0 * * *" # every night at midnight
workflow_dispatch:

jobs:
PullUpstream:
runs-on: ubuntu-latest
strategy:
fail-fast: false # run all jobs in the matrix even if one fails
matrix:
branch:
- "master"
- "backports-release-1.10"
- "backports-release-1.9"
steps:
- name: Checkout RAI/julia
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- name: Update ${{ matrix.branch }}
run: |
git config --global user.email "julia-engineering@relational.ai"
git config --global user.name "RAI CI (GitHub Action Automation)"

git remote add upstream https://github.com/JuliaLang/julia
git pull upstream ${{ matrix.branch }}
git push origin ${{ matrix.branch }}
1 change: 0 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ New library functions
* `copyuntil(out, io, delim)` and `copyline(out, io)` copy data into an `out::IO` stream ([#48273]).
* `eachrsplit(string, pattern)` iterates split substrings right to left.
* `Sys.username()` can be used to return the current user's username ([#51897]).
* `wrap(Array, m::Union{MemoryRef{T}, Memory{T}}, dims)` is the safe counterpart to `unsafe_wrap` ([#52049]).
* `GC.logging_enabled()` can be used to test whether GC logging has been enabled via `GC.enable_logging` ([#51647]).
* `IdSet` is now exported from Base and considered public ([#53262]).

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2009-2023: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors: https://github.com/JuliaLang/julia/contributors
Copyright (c) 2009-2024: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors: https://github.com/JuliaLang/julia/contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
19 changes: 16 additions & 3 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ JL_MAJOR_SHLIB_EXT := $(SHLIB_EXT).$(SOMAJOR)
endif
endif

ifeq ($(OS), FreeBSD)
ifneq ($(findstring $(OS),FreeBSD OpenBSD),)
LOCALBASE ?= /usr/local
else
LOCALBASE ?= /usr
Expand Down Expand Up @@ -726,7 +726,7 @@ SANITIZE_LDFLAGS :=
ifeq ($(SANITIZE_MEMORY),1)
SANITIZE_OPTS += -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer
SANITIZE_LDFLAGS += $(SANITIZE_OPTS)
ifneq ($(findstring $(OS),Linux FreeBSD),)
ifneq ($(findstring $(OS),Linux FreeBSD OpenBSD),)
SANITIZE_LDFLAGS += -Wl,--warn-unresolved-symbols
endif # OS Linux or FreeBSD
endif # SANITIZE_MEMORY=1
Expand Down Expand Up @@ -1069,7 +1069,7 @@ JCFLAGS+=-DSYSTEM_LIBUNWIND
JCPPFLAGS+=-DSYSTEM_LIBUNWIND
endif
else
ifeq ($(OS),Darwin)
ifneq ($(findstring $(OS),Darwin OpenBSD),)
LIBUNWIND:=-lunwind
JCPPFLAGS+=-DLLVMLIBUNWIND
else
Expand Down Expand Up @@ -1380,6 +1380,19 @@ OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(BUILDROOT)/src/julia.expma
$(NO_WHOLE_ARCHIVE)
endif

ifeq ($(OS), OpenBSD)
JLDFLAGS += -Wl,--Bdynamic
ifneq ($(SANITIZE),1)
JLDFLAGS += -Wl,-no-undefined
endif

JLIBLDFLAGS += -Wl,-Bsymbolic-functions

OSLIBS += -Wl,--no-as-needed -lpthread -lm -lc++abi -lc
OSLIBS += -Wl,--whole-archive -lcompiler_rt -Wl,--no-whole-archive
OSLIBS += -Wl,--export-dynamic,--as-needed,--version-script=$(BUILDROOT)/src/julia.expmap
endif

ifeq ($(OS), Darwin)
SHLIB_EXT := dylib
OSLIBS += -framework CoreFoundation
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ win-extras:
ifeq ($(USE_SYSTEM_LLVM), 1)
LLVM_SIZE := llvm-size$(EXE)
else
LLVM_SIZE := $(build_depsbindir)/llvm-size$(EXE)
LLVM_SIZE := PATH=$(build_bindir):$$PATH; $(build_depsbindir)/llvm-size$(EXE)
endif
build-stats:
ifeq ($(USE_BINARYBUILDER_LLVM),1)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Language changes
Compiler/Runtime improvements
-----------------------------

- Generated LLVM IR now uses actual pointer types instead of passing pointers as integers.
This affects `llvmcall`: Inline LLVM IR should be updated to use `i8*` or `ptr` instead of
`i32` or `i64`, and remove unneeded `ptrtoint`/`inttoptr` conversions. For compatibility,
IR with integer pointers is still supported, but generates a deprecation warning. ([#53687])

Command-line option changes
---------------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ and then use the command prompt to change into the resulting julia directory. By
Julia. However, most users should use the [most recent stable version](https://github.com/JuliaLang/julia/releases)
of Julia. You can get this version by running:

git checkout v1.10.0
git checkout v1.10.2

To build the `julia` executable, run `make` from within the julia directory.

Expand Down
51 changes: 0 additions & 51 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3080,54 +3080,3 @@ intersect(r::AbstractRange, v::AbstractVector) = intersect(v, r)
_getindex(v, i)
end
end

"""
wrap(Array, m::Union{Memory{T}, MemoryRef{T}}, dims)

Create an array of size `dims` using `m` as the underlying memory. This can be thought of as a safe version
of [`unsafe_wrap`](@ref) utilizing `Memory` or `MemoryRef` instead of raw pointers.
"""
function wrap end

# validity checking for _wrap calls, separate from allocation of Array so that it can be more likely to inline into the caller
function _wrap(ref::MemoryRef{T}, dims::NTuple{N, Int}) where {T, N}
mem = ref.mem
mem_len = length(mem) + 1 - memoryrefoffset(ref)
len = Core.checked_dims(dims...)
@boundscheck mem_len >= len || invalid_wrap_err(mem_len, dims, len)
if N != 1 && !(ref === GenericMemoryRef(mem) && len === mem_len)
mem = ccall(:jl_genericmemory_slice, Memory{T}, (Any, Ptr{Cvoid}, Int), mem, ref.ptr_or_offset, len)
ref = MemoryRef(mem)
end
return ref
end

@noinline invalid_wrap_err(len, dims, proddims) = throw(DimensionMismatch(
"Attempted to wrap a MemoryRef of length $len with an Array of size dims=$dims, which is invalid because prod(dims) = $proddims > $len, so that the array would have more elements than the underlying memory can store."))

@eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, dims::NTuple{N, Integer}) where {T, N}
dims = convert(Dims, dims)
ref = _wrap(m, dims)
$(Expr(:new, :(Array{T, N}), :ref, :dims))
end

@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, dims::NTuple{N, Integer}) where {T, N}
dims = convert(Dims, dims)
ref = _wrap(MemoryRef(m), dims)
$(Expr(:new, :(Array{T, N}), :ref, :dims))
end
@eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, l::Integer) where {T}
dims = (Int(l),)
ref = _wrap(m, dims)
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
end
@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, l::Integer) where {T}
dims = (Int(l),)
ref = _wrap(MemoryRef(m), (l,))
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
end
@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}) where {T}
ref = MemoryRef(m)
dims = (length(m),)
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
end
12 changes: 6 additions & 6 deletions base/atomics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,13 @@ for typ in atomictypes
irt = "$ilt, $ilt*"
@eval getindex(x::Atomic{$typ}) =
GC.@preserve x llvmcall($"""
%ptr = inttoptr i$WORD_SIZE %0 to $lt*
%ptr = bitcast i8* %0 to $lt*
%rv = load atomic $rt %ptr acquire, align $(gc_alignment(typ))
ret $lt %rv
""", $typ, Tuple{Ptr{$typ}}, unsafe_convert(Ptr{$typ}, x))
@eval setindex!(x::Atomic{$typ}, v::$typ) =
GC.@preserve x llvmcall($"""
%ptr = inttoptr i$WORD_SIZE %0 to $lt*
%ptr = bitcast i8* %0 to $lt*
store atomic $lt %1, $lt* %ptr release, align $(gc_alignment(typ))
ret void
""", Cvoid, Tuple{Ptr{$typ}, $typ}, unsafe_convert(Ptr{$typ}, x), v)
Expand All @@ -379,7 +379,7 @@ for typ in atomictypes
if typ <: Integer
@eval atomic_cas!(x::Atomic{$typ}, cmp::$typ, new::$typ) =
GC.@preserve x llvmcall($"""
%ptr = inttoptr i$WORD_SIZE %0 to $lt*
%ptr = bitcast i8* %0 to $lt*
%rs = cmpxchg $lt* %ptr, $lt %1, $lt %2 acq_rel acquire
%rv = extractvalue { $lt, i1 } %rs, 0
ret $lt %rv
Expand All @@ -388,7 +388,7 @@ for typ in atomictypes
else
@eval atomic_cas!(x::Atomic{$typ}, cmp::$typ, new::$typ) =
GC.@preserve x llvmcall($"""
%iptr = inttoptr i$WORD_SIZE %0 to $ilt*
%iptr = bitcast i8* %0 to $ilt*
%icmp = bitcast $lt %1 to $ilt
%inew = bitcast $lt %2 to $ilt
%irs = cmpxchg $ilt* %iptr, $ilt %icmp, $ilt %inew acq_rel acquire
Expand All @@ -411,15 +411,15 @@ for typ in atomictypes
if typ <: Integer
@eval $fn(x::Atomic{$typ}, v::$typ) =
GC.@preserve x llvmcall($"""
%ptr = inttoptr i$WORD_SIZE %0 to $lt*
%ptr = bitcast i8* %0 to $lt*
%rv = atomicrmw $rmw $lt* %ptr, $lt %1 acq_rel
ret $lt %rv
""", $typ, Tuple{Ptr{$typ}, $typ}, unsafe_convert(Ptr{$typ}, x), v)
else
rmwop === :xchg || continue
@eval $fn(x::Atomic{$typ}, v::$typ) =
GC.@preserve x llvmcall($"""
%iptr = inttoptr i$WORD_SIZE %0 to $ilt*
%iptr = bitcast i8* %0 to $ilt*
%ival = bitcast $lt %1 to $ilt
%irv = atomicrmw $rmw $ilt* %iptr, $ilt %ival acq_rel
%rv = bitcast $ilt %irv to $lt
Expand Down
18 changes: 14 additions & 4 deletions base/binaryplatforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function validate_tags(tags::Dict)
throw_invalid_key("arch")
end
# Validate `os`
if tags["os"] ∉ ("linux", "macos", "freebsd", "windows")
if tags["os"] ∉ ("linux", "macos", "freebsd", "openbsd", "windows")
throw_invalid_key("os")
end
# Validate `os`/`arch` combination
Expand Down Expand Up @@ -375,8 +375,10 @@ function os()
return "windows"
elseif Sys.isapple()
return "macos"
elseif Sys.isbsd()
elseif Sys.isfreebsd()
return "freebsd"
elseif Sys.isopenbsd()
return "openbsd"
else
return "linux"
end
Expand Down Expand Up @@ -422,6 +424,7 @@ const platform_names = Dict(
"macos" => "macOS",
"windows" => "Windows",
"freebsd" => "FreeBSD",
"openbsd" => "OpenBSD",
nothing => "Unknown",
)

Expand Down Expand Up @@ -556,6 +559,8 @@ function os_str(p::AbstractPlatform)
else
return "-unknown-freebsd"
end
elseif os(p) == "openbsd"
return "-unknown-openbsd"
else
return "-unknown"
end
Expand All @@ -581,7 +586,8 @@ Sys.isapple(p::AbstractPlatform) = os(p) == "macos"
Sys.islinux(p::AbstractPlatform) = os(p) == "linux"
Sys.iswindows(p::AbstractPlatform) = os(p) == "windows"
Sys.isfreebsd(p::AbstractPlatform) = os(p) == "freebsd"
Sys.isbsd(p::AbstractPlatform) = os(p) ∈ ("freebsd", "macos")
Sys.isopenbsd(p::AbstractPlatform) = os(p) == "openbsd"
Sys.isbsd(p::AbstractPlatform) = os(p) ∈ ("freebsd", "openbsd", "macos")
Sys.isunix(p::AbstractPlatform) = Sys.isbsd(p) || Sys.islinux(p)

const arch_mapping = Dict(
Expand Down Expand Up @@ -632,6 +638,7 @@ end
const os_mapping = Dict(
"macos" => "-apple-darwin[\\d\\.]*",
"freebsd" => "-(.*-)?freebsd[\\d\\.]*",
"openbsd" => "-(.*-)?openbsd[\\d\\.]*",
"windows" => "-w64-mingw32",
"linux" => "-(.*-)?linux",
)
Expand Down Expand Up @@ -745,6 +752,9 @@ function Base.parse(::Type{Platform}, triplet::String; validate_strict::Bool = f
if os == "freebsd"
os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)"sa)
end
if os == "openbsd"
os_version = extract_os_version("openbsd", r".*openbsd([\d.]+)"sa)
end
tags["os_version"] = os_version

return Platform(arch, os, tags; validate_strict)
Expand Down Expand Up @@ -802,7 +812,7 @@ function parse_dl_name_version(path::String, os::String)
# On OSX, libraries look like `libnettle.6.3.dylib`
dlregex = r"^(.*?)((?:\.[\d]+)*)\.dylib$"sa
else
# On Linux and FreeBSD, libraries look like `libnettle.so.6.3.0`
# On Linux and others BSD, libraries look like `libnettle.so.6.3.0`
dlregex = r"^(.*?)\.so((?:\.[\d]+)*)$"sa
end

Expand Down
2 changes: 1 addition & 1 deletion base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ end
reshape(B::BitArray, dims::Tuple{Vararg{Int}}) = _bitreshape(B, dims)
function _bitreshape(B::BitArray, dims::NTuple{N,Int}) where N
prod(dims) == length(B) ||
throw(DimensionMismatch("new dimensions $(dims) must be consistent with array size $(length(B))"))
throw(DimensionMismatch("new dimensions $(dims) must be consistent with array length $(length(B))"))
Br = BitArray{N}(undef, ntuple(i->0,Val(N))...)
Br.chunks = B.chunks
Br.len = prod(dims)
Expand Down
2 changes: 1 addition & 1 deletion base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ function is_top_bit_set(x::Union{Int8,UInt8})
end

# n.b. This function exists for CUDA to overload to configure error behavior (see #48097)
throw_inexacterror(args...) = throw(InexactError(args...))
throw_inexacterror(func::Symbol, to, val) = throw(InexactError(func, to, val))

function check_sign_bit(::Type{To}, x) where {To}
@inline
Expand Down
6 changes: 3 additions & 3 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ function _bcs(shape::Tuple, newshape::Tuple)
return (_bcs1(shape[1], newshape[1]), _bcs(tail(shape), tail(newshape))...)
end
# _bcs1 handles the logic for a single dimension
_bcs1(a::Integer, b::Integer) = a == 1 ? b : (b == 1 ? a : (a == b ? a : throw(DimensionMismatch("arrays could not be broadcast to a common size; got a dimension with lengths $a and $b"))))
_bcs1(a::Integer, b) = a == 1 ? b : (first(b) == 1 && last(b) == a ? b : throw(DimensionMismatch("arrays could not be broadcast to a common size; got a dimension with lengths $a and $(length(b))")))
_bcs1(a::Integer, b::Integer) = a == 1 ? b : (b == 1 ? a : (a == b ? a : throw(DimensionMismatch(LazyString("arrays could not be broadcast to a common size; got a dimension with lengths ", a, " and ", b)))))
_bcs1(a::Integer, b) = a == 1 ? b : (first(b) == 1 && last(b) == a ? b : throw(DimensionMismatch(LazyString("arrays could not be broadcast to a common size; got a dimension with lengths ", a, " and ", length(b)))))
_bcs1(a, b::Integer) = _bcs1(b, a)
_bcs1(a, b) = _bcsm(b, a) ? axistype(b, a) : _bcsm(a, b) ? axistype(a, b) : throw(DimensionMismatch(LazyString("arrays could not be broadcast to a common size: a has axes ", a, " and b has axes ", b)))
# _bcsm tests whether the second index is consistent with the first
Expand Down Expand Up @@ -1057,7 +1057,7 @@ end


@noinline throwdm(axdest, axsrc) =
throw(DimensionMismatch("destination axes $axdest are not compatible with source axes $axsrc"))
throw(DimensionMismatch(LazyString("destination axes ", axdest, " are not compatible with source axes ", axsrc)))

function restart_copyto_nonleaf!(newdest, dest, bc, val, I, iter, state, count)
# Function barrier that makes the copying to newdest type stable
Expand Down
Loading
Loading