Skip to content

Commit 320841b

Browse files
authored
Add a Symbolic ASR pass (#2255)
All tests pass and use it now. LLVM enabled.
1 parent b5a0ce9 commit 320841b

File tree

6 files changed

+1995
-6
lines changed

6 files changed

+1995
-6
lines changed

integration_tests/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -678,12 +678,12 @@ RUN(NAME structs_32 LABELS cpython llvm c)
678678
RUN(NAME structs_33 LABELS cpython llvm c)
679679
RUN(NAME structs_34 LABELS cpython llvm c)
680680

681-
RUN(NAME symbolics_01 LABELS cpython_sym c_sym)
682-
RUN(NAME symbolics_02 LABELS cpython_sym c_sym)
683-
RUN(NAME symbolics_03 LABELS cpython_sym c_sym)
684-
RUN(NAME symbolics_04 LABELS cpython_sym c_sym)
685-
RUN(NAME symbolics_05 LABELS cpython_sym c_sym)
686-
RUN(NAME symbolics_06 LABELS cpython_sym c_sym)
681+
RUN(NAME symbolics_01 LABELS cpython_sym c_sym llvm_sym NOFAST)
682+
RUN(NAME symbolics_02 LABELS cpython_sym c_sym llvm_sym NOFAST)
683+
RUN(NAME symbolics_03 LABELS cpython_sym c_sym llvm_sym NOFAST)
684+
RUN(NAME symbolics_04 LABELS cpython_sym c_sym llvm_sym NOFAST)
685+
RUN(NAME symbolics_05 LABELS cpython_sym c_sym llvm_sym NOFAST)
686+
RUN(NAME symbolics_06 LABELS cpython_sym c_sym llvm_sym NOFAST)
687687
RUN(NAME symbolics_07 LABELS cpython_sym c_sym llvm_sym NOFAST)
688688
RUN(NAME symbolics_08 LABELS cpython_sym c_sym llvm_sym)
689689

src/libasr/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ set(SRC
4848
pass/unused_functions.cpp
4949
pass/flip_sign.cpp
5050
pass/div_to_mul.cpp
51+
pass/replace_symbolic.cpp
5152
pass/intrinsic_function.cpp
5253
pass/fma.cpp
5354
pass/loop_vectorise.cpp

src/libasr/gen_pass.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"replace_implied_do_loops",
1313
"replace_init_expr",
1414
"inline_function_calls",
15+
"replace_symbolic",
1516
"replace_intrinsic_function",
1617
"loop_unroll",
1718
"loop_vectorise",

src/libasr/pass/pass_manager.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <libasr/pass/replace_arr_slice.h>
2929
#include <libasr/pass/replace_flip_sign.h>
3030
#include <libasr/pass/replace_div_to_mul.h>
31+
#include <libasr/pass/replace_symbolic.h>
3132
#include <libasr/pass/replace_intrinsic_function.h>
3233
#include <libasr/pass/replace_fma.h>
3334
#include <libasr/pass/loop_unroll.h>
@@ -71,6 +72,7 @@ namespace LCompilers {
7172
{"global_stmts", &pass_wrap_global_stmts},
7273
{"implied_do_loops", &pass_replace_implied_do_loops},
7374
{"array_op", &pass_replace_array_op},
75+
{"symbolic", &pass_replace_symbolic},
7476
{"intrinsic_function", &pass_replace_intrinsic_function},
7577
{"arr_slice", &pass_replace_arr_slice},
7678
{"print_arr", &pass_replace_print_arr},
@@ -203,6 +205,7 @@ namespace LCompilers {
203205
"subroutine_from_function",
204206
"where",
205207
"array_op",
208+
"symbolic",
206209
"intrinsic_function",
207210
"array_op",
208211
"pass_array_by_data",

0 commit comments

Comments
 (0)