Skip to content

Commit

Permalink
Merge branch 'master' into DateTime_subtraction
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Jun 24, 2023
2 parents 2aed549 + c59468a commit e337bee
Show file tree
Hide file tree
Showing 35 changed files with 939 additions and 511 deletions.
6 changes: 6 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,12 @@ endef
# Overridable in Make.user
WINE ?= wine

ifeq ($(BINARY),32)
HEAPLIM := --heap-size-hint=500M
else
HEAPLIM :=
endif

# many of the following targets must be = not := because the expansion of the makefile functions (and $1) shouldn't happen until later
ifeq ($(BUILD_OS), WINNT) # MSYS
spawn = $(1)
Expand Down
1 change: 1 addition & 0 deletions contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
print("Total ─────── "); Base.time_print(stdout, tot_time); println()
finally
fancyprint && print(ansi_enablecursor)
GC.gc(true); GC.gc(false); # reduce memory footprint
return
end

Expand Down
6 changes: 3 additions & 3 deletions sysimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ RELBUILDROOT := $(call rel_path,$(JULIAHOME)/base,$(BUILDROOT)/base)/ # <-- make

$(build_private_libdir)/corecompiler.ji: $(COMPILER_SRCS)
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
$(call spawn,$(JULIA_EXECUTABLE)) -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp \
$(call spawn,$(JULIA_EXECUTABLE)) -C "$(JULIA_CPU_TARGET)" $(HEAPLIM) --output-ji $(call cygpath_w,$@).tmp \
--startup-file=no --warn-overwrite=yes -g$(BOOTSTRAP_DEBUG_LEVEL) -O0 compiler/compiler.jl)
@mv $@.tmp $@

$(build_private_libdir)/sys.ji: $(build_private_libdir)/corecompiler.ji $(JULIAHOME)/VERSION $(BASE_SRCS) $(STDLIB_SRCS)
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
if ! JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) WINEPATH="$(call cygpath_w,$(build_bindir));$$WINEPATH" \
$(call spawn, $(JULIA_EXECUTABLE)) -g1 -O0 -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp $(JULIA_SYSIMG_BUILD_FLAGS) \
$(call spawn, $(JULIA_EXECUTABLE)) -g1 -O0 -C "$(JULIA_CPU_TARGET)" $(HEAPLIM) --output-ji $(call cygpath_w,$@).tmp $(JULIA_SYSIMG_BUILD_FLAGS) \
--startup-file=no --warn-overwrite=yes --sysimage $(call cygpath_w,$<) sysimg.jl $(RELBUILDROOT); then \
echo '*** This error might be fixed by running `make clean`. If the error persists$(COMMA) try `make cleanall`. ***'; \
false; \
Expand All @@ -82,7 +82,7 @@ $$(build_private_libdir)/sys$1-o.a $$(build_private_libdir)/sys$1-bc.a : $$(buil
JULIA_PROJECT= \
JULIA_DEPOT_PATH=':' \
JULIA_NUM_THREADS=1 \
$$(call spawn, $3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
$$(call spawn, $3) $2 -C "$$(JULIA_CPU_TARGET)" $$(HEAPLIM) --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl) $(JULIA_PRECOMPILE); then \
echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***'; \
false; \
Expand Down
40 changes: 0 additions & 40 deletions test/llvmpasses/alloc-opt-gcframe-addrspaces.jl

This file was deleted.

42 changes: 42 additions & 0 deletions test/llvmpasses/alloc-opt-gcframe-addrspaces.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
; This file is a part of Julia. License is MIT: https://julialang.org/license

; RUN: opt -enable-new-pm=0 --opaque-pointers=0 -load libjulia-codegen%shlibext -AllocOpt -S %s | FileCheck %s --check-prefixes=CHECK,TYPED
; RUN: opt -enable-new-pm=1 --opaque-pointers=0 --load-pass-plugin=libjulia-codegen%shlibext -passes='function(AllocOpt)' -S %s | FileCheck %s --check-prefixes=CHECK,TYPED

; RUN: opt -enable-new-pm=0 --opaque-pointers=1 -load libjulia-codegen%shlibext -AllocOpt -S %s | FileCheck %s --check-prefixes=CHECK,OPAQUE
; RUN: opt -enable-new-pm=1 --opaque-pointers=1 --load-pass-plugin=libjulia-codegen%shlibext -passes='function(AllocOpt)' -S %s | FileCheck %s --check-prefixes=CHECK,OPAQUE

target triple = "amdgcn-amd-amdhsa"
target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7-ni:10:11:12:13"

@tag = external addrspace(10) global {}

declare {}*** @julia.ptls_states()
declare {}*** @julia.get_pgcstack()
declare noalias {} addrspace(10)* @julia.gc_alloc_obj(i8*, i64, {} addrspace(10)*)
declare {}* @julia.pointer_from_objref({} addrspace(11)*)

; Test that non-0 addrspace allocas are properly emitted and handled

; CHECK-LABEL: @non_zero_addrspace
; CHECK: %1 = alloca i32, align 8, addrspace(5)

; TYPED: %2 = bitcast i32 addrspace(5)* %1 to i8 addrspace(5)*
; TYPED: %3 = bitcast i8 addrspace(5)* %2 to {} addrspace(5)*
; TYPED: %var1 = addrspacecast {} addrspace(5)* %3 to {} addrspace(10)*
; TYPED: call void @llvm.lifetime.start.p5i8(i64 4, i8 addrspace(5)* %2)

; OPAQUE: %var1 = addrspacecast ptr addrspace(5) %1 to ptr addrspace(10)
; OPAQUE: call void @llvm.lifetime.start.p5(i64 4, ptr addrspace(5) %1)

; CHECK: ret void
define void @non_zero_addrspace() {
%pgcstack = call {}*** @julia.get_pgcstack()
%ptls = call {}*** @julia.ptls_states()
%ptls_i8 = bitcast {}*** %ptls to i8*
%var1 = call {} addrspace(10)* @julia.gc_alloc_obj(i8* %ptls_i8, i64 4, {} addrspace(10)* @tag)
%var2 = addrspacecast {} addrspace(10)* %var1 to {} addrspace(11)*
%var3 = call {}* @julia.pointer_from_objref({} addrspace(11)* %var2)
ret void
}
; CHECK-LABEL: }{{$}}
Loading

0 comments on commit e337bee

Please sign in to comment.