28 if (argument.
nusers() != 1)
40 return argument !=
nullptr;
52 auto argument =
lambdaNode.subregion()->argument(
i);
62 std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
newResultTypes;
82 op.callingConvention(),
89 auto origin =
ctxvar.input->origin();
97 for (
auto argument :
lambdaNode.GetFunctionArguments())
108 for (
auto result :
lambdaNode.GetFunctionResults())
120 (*
lambdaNode.output()->Users().begin()).region()
121 == &
lambdaNode.region()->graph()->GetRootRegion());
132static std::optional<rvsdg::GammaNode::ExitVar>
135 if (argument.
nusers() == 1)
154 std::optional<rvsdg::GammaNode::ExitVar>
exitvar0 =
163 auto exitvar = TryGetSingleUserExitVar(gammaNode, *argument);
164 return exitvar && exitvar->output == exitvar0->output;
~UnusedStateRemoval() noexcept override
void Run(rvsdg::RvsdgModule &rvsdgModule, util::StatisticsCollector &statisticsCollector) override
Perform RVSDG transformation.
rvsdg::GraphExport * GetRvsdgExport() const noexcept
static std::unique_ptr< LlvmLambdaOperation > Create(std::shared_ptr< const jlm::rvsdg::FunctionType > type, std::string name, const jlm::llvm::Linkage &linkage, jlm::llvm::CallingConvention callingConvention, jlm::llvm::AttributeSet attributes)
static std::shared_ptr< const FunctionType > Create(std::vector< std::shared_ptr< const jlm::rvsdg::Type > > argumentTypes, std::vector< std::shared_ptr< const jlm::rvsdg::Type > > resultTypes)
const std::vector< std::shared_ptr< const jlm::rvsdg::Type > > & Arguments() const noexcept
Conditional operator / pattern matching.
void RemoveEntryVars(const std::vector< EntryVar > &entryVars)
Removes the given entry variables.
std::vector< EntryVar > GetEntryVars() const
Gets all entry variables for this gamma.
void RemoveExitVars(const std::vector< Output * > &gammaOutputs)
Removes the exit variables corresponding to the given gammaOutputs.
ExitVar MapBranchResultExitVar(const rvsdg::Input &input) const
Maps gamma region exit result to exit variable description.
static GraphExport & Create(Output &origin, std::string name)
static LambdaNode * Create(rvsdg::Region &parent, std::unique_ptr< LambdaOperation > operation)
const FunctionType & type() const noexcept
size_t nusers() const noexcept
Represents the argument of a region.
Represent acyclic RVSDG subgraphs.
void RemoveLoopVars(std::vector< LoopVar > loopVars)
Removes loop variables.
std::vector< LoopVar > GetLoopVars() const
Returns all loop variables.
static bool IsPassthroughResult(const rvsdg::Input &result)
static void RemoveUnusedStatesInRegion(rvsdg::Region ®ion)
static std::optional< rvsdg::GammaNode::ExitVar > TryGetSingleUserExitVar(rvsdg::GammaNode &gammaNode, rvsdg::Output &argument)
static void RemoveUnusedStatesFromThetaNode(rvsdg::ThetaNode &thetaNode)
static bool IsPassthroughArgument(const rvsdg::Output &argument)
static void RemoveUnusedStatesFromGammaNode(rvsdg::GammaNode &gammaNode)
static bool IsPassthroughLoopVar(const rvsdg::ThetaNode::LoopVar &loopVar)
static void RemoveUnusedStatesInStructuralNode(rvsdg::StructuralNode &structuralNode)
static void RemoveUnusedStatesFromLambda(rvsdg::LambdaNode &lambdaNode)
CallSummary ComputeCallSummary(const rvsdg::LambdaNode &lambdaNode)
static bool ThetaLoopVarIsInvariant(const ThetaNode::LoopVar &loopVar) noexcept
static void remove(Node *node)
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
detail::TopDownTraverserGeneric< false > TopDownTraverser
Traverser for visiting every node in a region in a top down order.
Description of a loop-carried variable.