|
Jlm
|
#include <Trace.hpp>

Public Member Functions | |
| virtual | ~OutputTracer () |
| OutputTracer (bool enableCaching) noexcept | |
| bool | isTracingThroughStructuralNodes () const noexcept |
| void | setTraceThroughStructuralNodes (bool value) noexcept |
| bool | isEnteringPhiNodes () const noexcept |
| void | setEnterPhiNodes (bool value) noexcept |
| bool | isInterprocedural () const noexcept |
| void | setInterprocedural (bool value) noexcept |
| Output & | trace (Output &output) |
| Output & | trace (Output &output, const rvsdg::Region *withinRegion) |
| Output * | tryTraceThroughGamma (GammaNode &gammaNode, Output &output) |
| Output * | tryTraceThroughTheta (ThetaNode &thetaNode, Output &output) |
| void | clearCache () |
Protected Member Functions | |
| virtual Output & | traceStep (Output &output, const rvsdg::Region *withinRegion) |
| Output * | insertInCache (const Output &output, Input *traceResult) |
| std::optional< Output * > | lookupInCache (const Output &output) |
Protected Attributes | |
| bool | traceThroughStrucutalNodes_ = true |
| bool | enterPhiNodes_ = true |
| bool | isInterprocedural_ = true |
| bool | enableCaching_ |
| std::unordered_map< const Output *, Input * > | traceCache_ {} |
Helper class for tracing through RVSDG graphs to find the origins of outputs. Traces through simple nodes that do not affect the value, through structural nodes when the value is invariant, and out of structural nodes when the value is passed in.
It supports caching of traced values at gamma and theta outputs to avoid the retracing of a value through these structural nodes.
|
virtualdefault |
|
explicitnoexcept |
Creates an OutputTracer with the default configuration
| enableCaching | Determines whether the output tracer should cache traced results. |
|
inline |
|
inlinenoexcept |
Controls if tracing is allowed to enter the subregion of a phi node from its outputs. If true, tracing can go further and reach lambda or delta nodes inside of phi nodes. It does, however, mean that the result of tracing can end up inside a region that is not an ancestor of the starting region in the region tree.
|
inlinenoexcept |
|
inlinenoexcept |
When tracing reaches the output of a structural node, how much effort should be made to check if the output is an invariant copy of one of the node's inputs. If true, tracing is performed inside the subregion(s) of the node. If false, only a simple invariant check is performed, which only detects invariance if the region result is directly connected to a region argument.
|
inlinenoexcept |
Enables or disables tracing into phi nodes from the outside.
| value | the new value |
|
inlinenoexcept |
Enables or disables interprocedural tracing.
| value | the new value |
|
inlinenoexcept |
Enables or disables tracing through the subregions of structural nodes.
| value | the new value |
| Output & jlm::rvsdg::OutputTracer::trace | ( | Output & | output, |
| const rvsdg::Region * | withinRegion | ||
| ) |
Traces from the given output to find the source of the output's value. The optional parameter withinRegion prevents values from being traced out of the region. If withinRegion is a nullptr, the tracing will continue until the output no longer changes.
| output | the output to trace from. |
| withinRegion | the region where we stop tracing. |
|
protectedvirtual |
The innermost body of the tracing loop. Should trace at least one step, if possible. If it is not possible to trace further, the same output is returned.
| output | the output to trace from. |
| withinRegion | if not nullptr, tracing stops if it reaches an argument of the region. |
output. Reimplemented in jlm::llvm::OutputTracer.
Attempts to trace the output of a gamma node through the node. This is only possible if the output can be traced to a gamma entry variable in all subregions, and these entry variables all share the same origin outside the gamma.
output is an output of the given gammaNode | gammaNode | the gamma node to trace through |
| output | an output of the given gamma node |
Attempts to trace the the given loop output through the theta node, resulting in the origin of one of the theta node's inputs if successful. This is only possible if the output belongs to an invariant loop variable, or if the loop variable's post result takes its value from another invariant loop variable.
output is an output of the given thetaNode | thetaNode | the theta node to trace through |
| output | an output of the given theta node |
|
protected |
|
protected |
|
protected |