|
Jlm
|
#include <gtest/gtest.h>#include <jlm/llvm/ir/operators/lambda.hpp>#include <jlm/llvm/ir/RvsdgModule.hpp>#include <jlm/llvm/opt/CommonNodeElimination.hpp>#include <jlm/rvsdg/bitstring/constant.hpp>#include <jlm/rvsdg/control.hpp>#include <jlm/rvsdg/gamma.hpp>#include <jlm/rvsdg/Phi.hpp>#include <jlm/rvsdg/TestOperations.hpp>#include <jlm/rvsdg/TestType.hpp>#include <jlm/rvsdg/theta.hpp>#include <jlm/rvsdg/view.hpp>#include <jlm/util/Statistics.hpp>
Go to the source code of this file.
Functions | |
| TEST (CommonNodeEliminationTests, test_simple) | |
| TEST (CommonNodeEliminationTests, test_gamma) | |
| TEST (CommonNodeEliminationTests, test_gamma_congruent_exit_vars) | |
| TEST (CommonNodeEliminationTests, test_theta) | |
| TEST (CommonNodeEliminationTests, test_theta2) | |
| TEST (CommonNodeEliminationTests, test_theta3) | |
| TEST (CommonNodeEliminationTests, test_theta4) | |
| TEST (CommonNodeEliminationTests, test_theta5) | |
| TEST (CommonNodeEliminationTests, MultipleThetas) | |
| TEST (CommonNodeEliminationTests, MultipleThetasPassthrough) | |
| TEST (CommonNodeEliminationTests, test_lambda) | |
| TEST (CommonNodeEliminationTests, test_phi) | |
| TEST (CommonNodeEliminationTests, EmptyTheta) | |
| TEST (CommonNodeEliminationTests, GammaInTheta) | |
Variables | |
| static jlm::util::StatisticsCollector | statisticsCollector |
| TEST | ( | CommonNodeEliminationTests | , |
| EmptyTheta | |||
| ) |
Definition at line 638 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| GammaInTheta | |||
| ) |
Creates a graph with a gamma node inside a theta node, that looks like:
10
/\
V V
+-----------------—+ | CTRL(0) | | | | V V V | | +----—+----—+ | | | \ | / | | | | V | V | | | +----—+----—+ | | V |
| USER1 |
|---|
| CTRL(0) 6 7 |
| V V V |
+-----------------—+
After performing CNE, the USER1 should still take its value from the gamma node, and not be re-routed to one of the loop variables, despite the loop variables appearing congruent in the first iteration.
Definition at line 679 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| MultipleThetas | |||
| ) |
Definition at line 454 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| MultipleThetasPassthrough | |||
| ) |
Definition at line 505 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_gamma | |||
| ) |
Definition at line 65 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_gamma_congruent_exit_vars | |||
| ) |
Creates an RVSDG graph that looks like c := GraphImport("c") // ControlType(2) a := GraphImport("a") // ValueType b := GraphImport("b") // ValueType a2, b2, x, y, z := gamma c, a, b [_, a0 <- a, b0 <- b] { } [a0 -> a2, b0 -> b2, a0 -> x, a0 -> y, b0 -> z] [_, a1 <- a, b1 <- b] { } [a1 -> a2, b1 -> b2, b1 -> x, b1 -> y, a1 -> z] GraphExport(a2) GraphExport(b2) GraphExport(x) GraphExport(y) GraphExport(z)
and checks the result of running CommonNodeElimination.
The exports of a2 and b2 should be redirected directly to the respective imports, while x and y should be merged into a single output. The z graph export should be left alone, as it is unique and non-invariant.
Definition at line 129 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_lambda | |||
| ) |
Definition at line 551 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_phi | |||
| ) |
Definition at line 586 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_simple | |||
| ) |
Definition at line 23 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_theta | |||
| ) |
Definition at line 207 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_theta2 | |||
| ) |
Definition at line 258 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_theta3 | |||
| ) |
Definition at line 301 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_theta4 | |||
| ) |
Definition at line 358 of file CommonNodeEliminationTests.cpp.
| TEST | ( | CommonNodeEliminationTests | , |
| test_theta5 | |||
| ) |
Definition at line 410 of file CommonNodeEliminationTests.cpp.
|
static |
Definition at line 21 of file CommonNodeEliminationTests.cpp.