13 #ifndef MLIR_DIALECT_LLVMIR_TRANSFORMS_DIEXPRESSIONREWRITER_H
14 #define MLIR_DIALECT_LLVMIR_TRANSFORMS_DIEXPRESSIONREWRITER_H
34 using OpIterT = std::deque<OperatorT>::const_iterator;
50 void addPattern(std::unique_ptr<ExprRewritePattern> pattern);
55 LLVM::DIExpressionAttr
56 simplify(LLVM::DIExpressionAttr expr,
57 std::optional<uint64_t> maxNumRewrites = {})
const;
virtual ~ExprRewritePattern()=default
DIExpressionRewriter::OperatorT OperatorT
virtual SmallVector< OperatorT > replace(OpIterRange) const =0
Replace the operators with a new list of operators.
virtual OpIterT match(OpIterRange) const =0
Checks whether a particular prefix of operators matches this pattern.
std::deque< OperatorT >::const_iterator OpIterT
Rewriter for DIExpressionAttr.
void addPattern(std::unique_ptr< ExprRewritePattern > pattern)
Register a rewrite pattern with the rewriter.
LLVM::DIExpressionElemAttr OperatorT
LLVM::DIExpressionAttr simplify(LLVM::DIExpressionAttr expr, std::optional< uint64_t > maxNumRewrites={}) const
Simplify a DIExpression according to all the patterns registered.
Include the generated interface declarations.