-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
AllocOpt: Fix stack lowering where alloca continas boxed and unboxed data #55306
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2517da3
AllocOpt: Fix stack lowering where object contains both julia and non…
wsmoses 398f318
fix test
wsmoses f012c57
rewrite
wsmoses 4c07af9
Update llvm-alloc-helpers.h
wsmoses 1eb8b91
Update llvm-alloc-helpers.h
wsmoses 4556719
Apply suggestions from code review
wsmoses 3ed59fd
Apply suggestions from code review
vchuravy 80b1a27
fixup
wsmoses d69046f
Merge branch 'master' into ao
gbaraldi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
; This file is a part of Julia. License is MIT: https://julialang.org/license | ||
|
||
; RUN: opt --load-pass-plugin=libjulia-codegen%shlibext -passes='function(AllocOpt)' -S %s | FileCheck %s | ||
|
||
|
||
@tag = external addrspace(10) global {} | ||
|
||
@glob = external addrspace(10) global {} | ||
|
||
; Test that the gc_preserve intrinsics are deleted directly. | ||
|
||
; CHECK-LABEL: @ptr_and_bits | ||
; CHECK-NOT: alloca | ||
; CHECK: call noalias ptr addrspace(10) @julia.gc_alloc_obj | ||
|
||
define void @ptr_and_bits(ptr %fptr, i1 %b, i1 %b2, i32 %idx) { | ||
%pgcstack = call ptr @julia.get_pgcstack() | ||
%ptls = call ptr @julia.ptls_states() | ||
%ptls_i8 = bitcast ptr %ptls to ptr | ||
%v = call noalias ptr addrspace(10) @julia.gc_alloc_obj(ptr %ptls_i8, i64 16, ptr addrspace(10) @tag) | ||
|
||
%g0 = getelementptr { i64, ptr addrspace(10) }, ptr addrspace(10) %v, i32 %idx, i32 1 | ||
store ptr addrspace(10) @glob, ptr addrspace(10) %g0 | ||
|
||
%g1 = getelementptr { i64, ptr addrspace(10) }, ptr addrspace(10) %v, i32 %idx, i32 0 | ||
store i64 7, ptr addrspace(10) %g1 | ||
|
||
%res = load ptr addrspace(10), ptr addrspace(10) %g0 | ||
%res2 = load i64, ptr addrspace(10) %g1 | ||
ret void | ||
} | ||
|
||
declare noalias ptr addrspace(10) @julia.gc_alloc_obj(ptr, i64, ptr addrspace(10)) | ||
|
||
declare ptr @julia.ptls_states() | ||
|
||
declare ptr @julia.get_pgcstack() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.