From c5f6087354f0fc5448fdc0505ebdd17255e5eb31 Mon Sep 17 00:00:00 2001 From: Thirumalai Shaktivel Date: Mon, 20 Nov 2023 09:31:57 +0530 Subject: [PATCH] [ASR Pass] Skip the direct multi-dimensional ArraySection assignment to the `SIMDArray`; use do_loop instead --- src/libasr/pass/array_op.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/libasr/pass/array_op.cpp b/src/libasr/pass/array_op.cpp index 4e7bc2495b..a1a6cabfcb 100644 --- a/src/libasr/pass/array_op.cpp +++ b/src/libasr/pass/array_op.cpp @@ -1623,10 +1623,18 @@ class ArrayOpVisitor : public ASR::CallReplacerOnExpressionsVisitor(*x.m_value)) { - this->visit_expr(*x.m_value); + size_t n_dims = 1; + if (ASR::is_a(*x.m_value)) { + n_dims = ASRUtils::extract_n_dims_from_ttype( + ASRUtils::expr_type(down_cast( + x.m_value)->m_v)); + } + if (n_dims == 1) { + if (!ASR::is_a(*x.m_value)) { + this->visit_expr(*x.m_value); + } + return; } - return; } if( (ASR::is_a(*ASRUtils::expr_type(x.m_target)) && ASR::is_a(*x.m_value)) ||