#include "TestDenseDataFlowAnalysis.h"
#include "TestDialect.h"
#include "TestOps.h"
#include "mlir/Analysis/DataFlow/ConstantPropagationAnalysis.h"
#include "mlir/Analysis/DataFlow/DeadCodeAnalysis.h"
#include "mlir/Analysis/DataFlow/DenseAnalysis.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/TypeSwitch.h"
#include <optional>
usingnamespacemlir;
usingnamespacemlir::dataflow;
usingnamespacemlir::dataflow::test;
namespace {
class LastModification : public AbstractDenseLattice, public AccessLatticeBase { … };
class LastModifiedAnalysis
: public DenseForwardDataFlowAnalysis<LastModification> { … };
}
LogicalResult LastModifiedAnalysis::visitOperation(
Operation *op, const LastModification &before, LastModification *after) { … }
void LastModifiedAnalysis::visitCallControlFlowTransfer(
CallOpInterface call, CallControlFlowAction action,
const LastModification &before, LastModification *after) { … }
void LastModifiedAnalysis::visitRegionBranchControlFlowTransfer(
RegionBranchOpInterface branch, std::optional<unsigned> regionFrom,
std::optional<unsigned> regionTo, const LastModification &before,
LastModification *after) { … }
namespace {
struct TestLastModifiedPass
: public PassWrapper<TestLastModifiedPass, OperationPass<>> { … };
}
namespace mlir {
namespace test {
void registerTestLastModifiedPass() { … }
}
}