11 #include "llvm/BinaryFormat/Dwarf.h"
22 if (it == operators.end() ||
23 it->getOpcode() != llvm::dwarf::DW_OP_LLVM_fragment)
24 return operators.begin();
27 if (it == operators.end() ||
28 it->getOpcode() != llvm::dwarf::DW_OP_LLVM_fragment)
29 return operators.begin();
41 uint64_t offset = first.getArguments()[0] + second.getArguments()[0];
42 uint64_t size = first.getArguments()[1];
44 first.getContext(), llvm::dwarf::DW_OP_LLVM_fragment, {offset, size});
54 rewriter.
addPattern(std::make_unique<MergeFragments>());
This is an attribute/type replacer that is naively cached.
DIExpressionRewriter::OperatorT OperatorT
std::deque< OperatorT >::const_iterator OpIterT
Rewriter for DIExpressionAttr.
void addPattern(std::unique_ptr< ExprRewritePattern > pattern)
Register a rewrite pattern with the rewriter.
LLVM::DIExpressionAttr simplify(LLVM::DIExpressionAttr expr, std::optional< uint64_t > maxNumRewrites={}) const
Simplify a DIExpression according to all the patterns registered.
OpIterT match(OpIterRange operators) const override
Checks whether a particular prefix of operators matches this pattern.
SmallVector< OperatorT > replace(OpIterRange operators) const override
Replace the operators with a new list of operators.
Operation is the basic unit of execution within MLIR.
void recursivelyReplaceElementsIn(Operation *op, bool replaceAttrs=true, bool replaceLocs=false, bool replaceTypes=false)
Replace the elements within the given operation, and all nested operations.
void addReplacement(ReplaceFn< Attribute > fn)
Register a replacement function for mapping a given attribute or type.
void legalizeDIExpressionsRecursively(Operation *op)
Register all known legalization patterns declared here and apply them to all ops in op.
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...