Skip to content

Commit

Permalink
[ASR Pass] Skip the direct multi-dimensional ArraySection assignment …
Browse files Browse the repository at this point in the history
…to the `SIMDArray`; use do_loop instead
  • Loading branch information
Thirumalai-Shaktivel committed Nov 20, 2023
1 parent a5e3d04 commit c5f6087
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/libasr/pass/array_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,10 +1623,18 @@ class ArrayOpVisitor : public ASR::CallReplacerOnExpressionsVisitor<ArrayOpVisit

void visit_Assignment(const ASR::Assignment_t &x) {
if (ASRUtils::is_simd_array(x.m_target)) {
if (!ASR::is_a<ASR::ArrayPhysicalCast_t>(*x.m_value)) {
this->visit_expr(*x.m_value);
size_t n_dims = 1;
if (ASR::is_a<ASR::ArraySection_t>(*x.m_value)) {
n_dims = ASRUtils::extract_n_dims_from_ttype(
ASRUtils::expr_type(down_cast<ASR::ArraySection_t>(
x.m_value)->m_v));
}
if (n_dims == 1) {
if (!ASR::is_a<ASR::ArrayPhysicalCast_t>(*x.m_value)) {
this->visit_expr(*x.m_value);
}
return;
}
return;
}
if( (ASR::is_a<ASR::Pointer_t>(*ASRUtils::expr_type(x.m_target)) &&
ASR::is_a<ASR::GetPointer_t>(*x.m_value)) ||
Expand Down

0 comments on commit c5f6087

Please sign in to comment.