Skip to content

Commit

Permalink
Merge branch 'master' into extrama
Browse files Browse the repository at this point in the history
  • Loading branch information
N5N3 committed Jan 18, 2022
2 parents 98d2743 + 45acb76 commit 2c57b1f
Show file tree
Hide file tree
Showing 52 changed files with 106 additions and 5,340 deletions.
5 changes: 3 additions & 2 deletions base/expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,16 @@ macro generated(f)
if isa(f, Expr) && (f.head === :function || is_short_function_def(f))
body = f.args[2]
lno = body.args[1]
tmp = gensym("tmp")
return Expr(:escape,
Expr(f.head, f.args[1],
Expr(:block,
lno,
Expr(:if, Expr(:generated),
# https://github.com/JuliaLang/julia/issues/25678
Expr(:block,
:(local tmp = $body),
:(if tmp isa Core.CodeInfo; return tmp; else tmp; end)),
:(local $tmp = $body),
:(if $tmp isa $(GlobalRef(Core, :CodeInfo)); return $tmp; else $tmp; end)),
Expr(:block,
Expr(:meta, :generated_only),
Expr(:return, nothing))))))
Expand Down
22 changes: 18 additions & 4 deletions base/reinterpretarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,15 @@ axes(a::NonReshapedReinterpretArray{T,0}) where {T} = ()
elsize(::Type{<:ReinterpretArray{T}}) where {T} = sizeof(T)
unsafe_convert(::Type{Ptr{T}}, a::ReinterpretArray{T,N,S} where N) where {T,S} = Ptr{T}(unsafe_convert(Ptr{S},a.parent))

@inline @propagate_inbounds getindex(a::NonReshapedReinterpretArray{T,0}) where {T} = reinterpret(T, a.parent[])
@inline @propagate_inbounds getindex(a::ReinterpretArray) = a[1]
@inline @propagate_inbounds function getindex(a::NonReshapedReinterpretArray{T,0,S}) where {T,S}
if isprimitivetype(T) && isprimitivetype(S)
reinterpret(T, a.parent[])
else
a[firstindex(a)]
end
end

@inline @propagate_inbounds getindex(a::ReinterpretArray) = a[firstindex(a)]

@inline @propagate_inbounds function getindex(a::ReinterpretArray{T,N,S}, inds::Vararg{Int, N}) where {T,N,S}
check_readable(a)
Expand Down Expand Up @@ -462,8 +469,15 @@ end
return t[][i1]
end

@inline @propagate_inbounds setindex!(a::NonReshapedReinterpretArray{T,0,S} where T, v) where {S} = (a.parent[] = reinterpret(S, v))
@inline @propagate_inbounds setindex!(a::ReinterpretArray, v) = (a[1] = v)
@inline @propagate_inbounds function setindex!(a::NonReshapedReinterpretArray{T,0,S}, v) where {T,S}
if isprimitivetype(S) && isprimitivetype(T)
a.parent[] = reinterpret(S, v)
return a
end
setindex!(a, v, firstindex(a))
end

@inline @propagate_inbounds setindex!(a::ReinterpretArray, v) = setindex!(a, v, firstindex(a))

@inline @propagate_inbounds function setindex!(a::ReinterpretArray{T,N,S}, v, inds::Vararg{Int, N}) where {T,N,S}
check_writable(a)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2b8de7d0df945b8f1f5cb1fee37633ca
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c8db2ee51368ef2230d5c0f97165549f74f327da1cc1e4af88a526f9ec73f3a19f48be844d360043a302bd004b7057a10db8c1d12902deb0232ac09b8fa954ad

This file was deleted.

This file was deleted.

44 changes: 2 additions & 42 deletions deps/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ LLVM_LIB_FILE := libLLVMCodeGen.a

# Figure out which targets to build
LLVM_TARGETS := host;NVPTX;AMDGPU;WebAssembly;BPF
LLVM_EXPERIMENTAL_TARGETS :=

LLVM_CFLAGS :=
LLVM_CXXFLAGS :=
Expand All @@ -83,6 +84,7 @@ LLVM_CXXFLAGS += $(CXXFLAGS)
LLVM_CPPFLAGS += $(CPPFLAGS)
LLVM_LDFLAGS += $(LDFLAGS)
LLVM_CMAKE += -DLLVM_TARGETS_TO_BUILD:STRING="$(LLVM_TARGETS)" -DCMAKE_BUILD_TYPE="$(LLVM_CMAKE_BUILDTYPE)"
LLVM_CMAKE += -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING="$(LLVM_EXPERIMENTAL_TARGETS)"
LLVM_CMAKE += -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_HOST_TRIPLE="$(or $(XC_HOST),$(BUILD_MACHINE))"
LLVM_CMAKE += -DLLVM_ENABLE_ZLIB=ON -DZLIB_LIBRARY="$(build_prefix)/lib"
LLVM_CMAKE += -DCOMPILER_RT_ENABLE_IOS=OFF -DCOMPILER_RT_ENABLE_WATCHOS=OFF -DCOMPILER_RT_ENABLE_TVOS=OFF
Expand Down Expand Up @@ -230,48 +232,6 @@ $$(LLVM_BUILDDIR_withtype)/build-compiled: $$(SRCCACHE)/$$(LLVM_SRC_DIR)/$1.patc
LLVM_PATCH_PREV := $$(SRCCACHE)/$$(LLVM_SRC_DIR)/$1.patch-applied
endef

ifeq ($(LLVM_VER_SHORT),11.0)
ifeq ($(LLVM_VER_PATCH), 0)
$(eval $(call LLVM_PATCH,llvm-D27629-AArch64-large_model_6.0.1)) # remove for LLVM 12
endif # LLVM_VER 11.0.0
$(eval $(call LLVM_PATCH,llvm8-D34078-vectorize-fdiv)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-7.0-D44650)) # replaced by D90969 for LLVM 12
$(eval $(call LLVM_PATCH,llvm-6.0-DISABLE_ABI_CHECKS)) # Needs upstreaming
$(eval $(call LLVM_PATCH,llvm9-D50010-VNCoercion-ni)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm7-revert-D44485)) # Needs upstreaming
$(eval $(call LLVM_PATCH,llvm-11-D75072-SCEV-add-type))
$(eval $(call LLVM_PATCH,llvm-julia-tsan-custom-as))
$(eval $(call LLVM_PATCH,llvm-D80101)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-D84031)) # remove for LLVM 12
ifeq ($(LLVM_VER_PATCH), 0)
$(eval $(call LLVM_PATCH,llvm-10-D85553)) # remove for LLVM 12
endif # LLVM_VER 11.0.0
$(eval $(call LLVM_PATCH,llvm-10-unique_function_clang-sa)) # Needs upstreaming
ifeq ($(BUILD_LLVM_CLANG),1)
$(eval $(call LLVM_PATCH,llvm-D88630-clang-cmake))
endif
ifeq ($(LLVM_VER_PATCH), 0)
$(eval $(call LLVM_PATCH,llvm-11-D85313-debuginfo-empty-arange)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-D90722-rtdyld-absolute-relocs)) # remove for LLVM 12
endif # LLVM_VER 11.0.0
$(eval $(call LLVM_PATCH,llvm-invalid-addrspacecast-sink)) # Still being upstreamed as D92210
$(eval $(call LLVM_PATCH,llvm-11-D92906-ppc-setjmp)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-PR48458-X86ISelDAGToDAG)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-D93092-ppc-knownbits)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-D93154-globalisel-as))
$(eval $(call LLVM_PATCH,llvm-11-ppc-half-ctr)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-ppc-sp-from-bp)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-rGb498303066a6-gcc11-header-fix)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-D94813-mergeicmps))
$(eval $(call LLVM_PATCH,llvm-11-D94980-CTR-half)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-D94058-sext-atomic-ops)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-D96283-dagcombine-half)) # remove for LLVM 12
$(eval $(call LLVM_PROJ_PATCH,llvm-11-AArch64-FastIsel-bug))
$(eval $(call LLVM_PROJ_PATCH,llvm-11-D97435-AArch64-movaddrreg))
$(eval $(call LLVM_PROJ_PATCH,llvm-11-D97571-AArch64-loh)) # remove for LLVM 13
$(eval $(call LLVM_PROJ_PATCH,llvm-11-aarch64-addrspace)) # remove for LLVM 13
endif # LLVM_VER 11.0

# NOTE: LLVM 12 and 13 have their patches applied to JuliaLang/llvm-project

# Add a JL prefix to the version map. DO NOT REMOVE
Expand Down
53 changes: 0 additions & 53 deletions deps/patches/llvm-10-D85553.patch

This file was deleted.

28 changes: 0 additions & 28 deletions deps/patches/llvm-10-unique_function_clang-sa.patch

This file was deleted.

50 changes: 0 additions & 50 deletions deps/patches/llvm-11-AArch64-FastIsel-bug.patch

This file was deleted.

Loading

0 comments on commit 2c57b1f

Please sign in to comment.