Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions jlm/llvm/opt/InvariantValueRedirection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ InvariantValueRedirection::redirectThetaOutputs(rvsdg::ThetaNode & thetaNode)
{
for (const auto & loopVar : thetaNode.GetLoopVars())
{
// FIXME: In order to also redirect I/O state type variables, we need to know whether a loop
// terminates.
if (rvsdg::is<IOStateType>(loopVar.input->Type()))
continue;

if (rvsdg::ThetaLoopVarIsInvariant(loopVar))
loopVar.output->divert_users(loopVar.input->origin());
}
Expand Down
18 changes: 9 additions & 9 deletions tests/jlm/llvm/opt/InvariantValueRedirectionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ TEST(InvariantValueRedirectionTests, TestTheta)
rvsdg.GetRootRegion(),
jlm::llvm::LlvmLambdaOperation::Create(functionType, "test", Linkage::externalLinkage));

auto c = lambdaNode->GetFunctionArguments()[0];
auto x = lambdaNode->GetFunctionArguments()[1];
auto l = lambdaNode->GetFunctionArguments()[2];
const auto controlArgument = lambdaNode->GetFunctionArguments()[0];
const auto valueArgument = lambdaNode->GetFunctionArguments()[1];
const auto ioStateArgument = lambdaNode->GetFunctionArguments()[2];

auto thetaNode1 = jlm::rvsdg::ThetaNode::create(lambdaNode->subregion());
auto thetaVar1 = thetaNode1->AddLoopVar(c);
auto thetaVar2 = thetaNode1->AddLoopVar(x);
auto thetaVar3 = thetaNode1->AddLoopVar(l);
auto thetaVar1 = thetaNode1->AddLoopVar(controlArgument);
auto thetaVar2 = thetaNode1->AddLoopVar(valueArgument);
auto thetaVar3 = thetaNode1->AddLoopVar(ioStateArgument);

auto thetaNode2 = jlm::rvsdg::ThetaNode::create(thetaNode1->subregion());
auto thetaVar4 = thetaNode2->AddLoopVar(thetaVar1.pre);
Expand All @@ -129,9 +129,9 @@ TEST(InvariantValueRedirectionTests, TestTheta)
RunInvariantValueRedirection(*rvsdgModule);

// Assert
EXPECT_EQ(lambdaNode->GetFunctionResults()[0]->origin(), c);
EXPECT_EQ(lambdaNode->GetFunctionResults()[1]->origin(), x);
EXPECT_EQ(lambdaNode->GetFunctionResults()[2]->origin(), thetaVar3.output);
EXPECT_EQ(lambdaNode->GetFunctionResults()[0]->origin(), controlArgument);
EXPECT_EQ(lambdaNode->GetFunctionResults()[1]->origin(), valueArgument);
EXPECT_EQ(lambdaNode->GetFunctionResults()[2]->origin(), ioStateArgument);
}

TEST(InvariantValueRedirectionTests, TestCall)
Expand Down
Loading