6#include <gtest/gtest.h>
29 auto lv1 = theta->AddLoopVar(
imp1);
30 auto lv2 = theta->AddLoopVar(
imp2);
31 auto lv3 = theta->AddLoopVar(
imp3);
33 lv2.post->divert_to(
lv3.pre);
34 lv3.post->divert_to(
lv3.pre);
35 theta->set_predicate(
lv1.pre);
47 EXPECT_EQ(theta->predicate(), theta->subregion()->result(0));
48 EXPECT_EQ(theta->GetLoopVars().size(), 3u);
49 EXPECT_EQ(theta->GetLoopVars()[0].post, theta->subregion()->result(1));
68 auto lv0 = thetaNode->AddLoopVar(
ctl);
69 auto lv1 = thetaNode->AddLoopVar(
x);
70 auto lv2 = thetaNode->AddLoopVar(
y);
71 thetaNode->set_predicate(
lv0.pre);
76 thetaNode->RemoveLoopVars({
lv1 });
77 auto loopvars = thetaNode->GetLoopVars();
100 auto loopVar2 = thetaNode->AddLoopVar(
y);
103 thetaNode->subregion(),
104 { loopVar1.pre, loopVar2.pre },
static Output & createFalse(Region ®ion)
static std::shared_ptr< const ControlType > Create(std::size_t nalternatives)
Instantiates control type.
static GraphExport & Create(Output &origin, std::string name)
static GraphImport & Create(Graph &graph, std::shared_ptr< const rvsdg::Type > type, std::string name)
Region & GetRootRegion() const noexcept
size_t numNodes() const noexcept
static SimpleNode * createNode(Region *region, const std::vector< Output * > &operands, std::vector< std::shared_ptr< const Type > > resultTypes)
static std::shared_ptr< const TestType > createValueType()
static bool reduceStaticallyKnownPredicate(Node &node)
static ThetaNode * create(rvsdg::Region *parent)
TEST(ThetaTests, TestThetaCreation)
std::string view(const rvsdg::Region *region)
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.