LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::CallGraphReachabilityAnalysis Class Reference

Lazily-constructed reachability analysis. More...

#include <CallGraphAnalyses.h>

Public Member Functions

 CallGraphReachabilityAnalysis (mlir::Operation *, mlir::AnalysisManager &am)
 NOTE: the need for the mlir::Operation argument is a requirement of the mlir::getAnalysis method, which requires template types to define a constructor that either takes only an mlir::Operation* (as in the CallGraphAnalysis above) or the signature below.
 
bool isInvalidated (const mlir::AnalysisManager::PreservedAnalyses &pa)
 
bool isReachable (function::FuncDefOp &A, function::FuncDefOp &B) const
 Returns whether B is reachable from A.
 
const llzk::CallGraphgetCallGraph () const
 

Detailed Description

Lazily-constructed reachability analysis.

Definition at line 54 of file CallGraphAnalyses.h.

Constructor & Destructor Documentation

◆ CallGraphReachabilityAnalysis()

llzk::CallGraphReachabilityAnalysis::CallGraphReachabilityAnalysis ( mlir::Operation * ,
mlir::AnalysisManager & am )

NOTE: the need for the mlir::Operation argument is a requirement of the mlir::getAnalysis method, which requires template types to define a constructor that either takes only an mlir::Operation* (as in the CallGraphAnalysis above) or the signature below.

See: https://github.com/llvm/llvm-project/blob/415cfaf339dc4383acd44248584bcc6376213c8d/mlir/include/mlir/Pass/AnalysisManager.h#L220-L234 https://mlir.llvm.org/docs/PassManagement/#querying-analyses

Definition at line 44 of file CallGraphAnalyses.cpp.

Member Function Documentation

◆ getCallGraph()

const llzk::CallGraph & llzk::CallGraphReachabilityAnalysis::getCallGraph ( ) const
inline

Definition at line 73 of file CallGraphAnalyses.h.

◆ isInvalidated()

bool llzk::CallGraphReachabilityAnalysis::isInvalidated ( const mlir::AnalysisManager::PreservedAnalyses & pa)
inline

Definition at line 66 of file CallGraphAnalyses.h.

◆ isReachable()

bool llzk::CallGraphReachabilityAnalysis::isReachable ( function::FuncDefOp & A,
function::FuncDefOp & B ) const

Returns whether B is reachable from A.

NOTE: This is a potential cause of performance issues, as some circuits may perform poorly for DFS. However, we don't have enough examples at this time to demonstrate such an issue, so we will stick with DFS for simplicity for now. If performance issues arise, it may be beneficial to switch to inverse DFS or a different algorithm entirely.

Definition at line 50 of file CallGraphAnalyses.cpp.


The documentation for this class was generated from the following files: