Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/llvm-alloc-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static void removeGCPreserve(CallInst *call, Instruction *val)
++RemovedGCPreserve;
auto replace = Constant::getNullValue(val->getType());
call->replaceUsesOfWith(val, replace);
call->setAttributes(AttributeList());
for (auto &arg: call->args()) {
if (!isa<Constant>(arg.get())) {
return;
Expand Down Expand Up @@ -1093,7 +1094,6 @@ void Optimizer::splitOnStack(CallInst *orig_inst)
}
auto new_call = builder.CreateCall(pass.gc_preserve_begin_func, operands);
new_call->takeName(call);
new_call->setAttributes(call->getAttributes());
call->replaceAllUsesWith(new_call);
call->eraseFromParent();
return;
Expand Down
4 changes: 2 additions & 2 deletions test/llvmpasses/alloc-opt-pass.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define void @preserve_branches(i8* %fptr, i1 %b, i1 %b2) {

L1:
%v = call noalias {} addrspace(10)* @julia.gc_alloc_obj(i8* %ptls_i8, $isz 8, {} addrspace(10)* @tag)
%tok = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* %v)
%tok = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* nonnull %v)
call void @external_function()
br i1 %b2, label %L2, label %L3

Expand Down Expand Up @@ -68,7 +68,7 @@ define void @preserve_branches2(i8* %fptr, i1 %b, i1 %b2) {

L1:
%v = call noalias {} addrspace(10)* @julia.gc_alloc_obj(i8* %ptls_i8, $isz 8, {} addrspace(10)* @tag)
%tok = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* %v, {} addrspace(10)* %v2)
%tok = call token (...) @llvm.julia.gc_preserve_begin({} addrspace(10)* %v, {} addrspace(10)* nonnull %v2)
call void @external_function()
br i1 %b2, label %L2, label %L3

Expand Down