Skip to content

Commit

Permalink
Handle reshape intrinsic initialisation with FixedSizeArray (lcom…
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel authored Jul 21, 2023
1 parent 92b1bfd commit 45c05ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libasr/codegen/asr_to_llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,6 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
llvm::Type* target_type = llvm_utils->get_type_from_ttype_t_util(x_m_array_type, module.get());
llvm::Value *target = builder0.CreateAlloca(
target_type, nullptr, "fixed_size_reshaped_array");
array = llvm_utils->create_gep(array, 0);
llvm::Value* target_ = llvm_utils->create_gep(target, 0);
ASR::dimension_t* asr_dims = nullptr;
size_t asr_n_dims = ASRUtils::extract_dimensions_from_ttype(x_m_array_type, asr_dims);
Expand Down Expand Up @@ -3172,6 +3171,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
builder->CreateMemCpy(llvm_utils->create_gep(target_var, 0),
llvm::MaybeAlign(), init_value, llvm::MaybeAlign(), arg_size);
}
} else if (ASR::is_a<ASR::ArrayReshape_t>(*v->m_symbolic_value)) {
builder->CreateStore(LLVM::CreateLoad(*builder, init_value), target_var);
} else {
builder->CreateStore(init_value, target_var);
}
Expand Down

0 comments on commit 45c05ee

Please sign in to comment.