MLIR 22.0.0git
mlir::LLVM::DIExpressionRewriter Class Reference

Rewriter for DIExpressionAttr. More...

#include "mlir/Dialect/LLVMIR/Transforms/DIExpressionRewriter.h"

Classes

class  ExprRewritePattern

Public Types

using OperatorT = LLVM::DIExpressionElemAttr

Public Member Functions

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.

Detailed Description

Rewriter for DIExpressionAttr.

Users of this rewriter register their own rewrite patterns. Each pattern matches on a contiguous range of LLVM DIExpressionElemAttrs, and can be used to rewrite it into a new range of DIExpressionElemAttrs of any length.

Definition at line 27 of file DIExpressionRewriter.h.

Member Typedef Documentation

◆ OperatorT

using mlir::LLVM::DIExpressionRewriter::OperatorT = LLVM::DIExpressionElemAttr

Definition at line 29 of file DIExpressionRewriter.h.

Member Function Documentation

◆ addPattern()

void DIExpressionRewriter::addPattern ( std::unique_ptr< ExprRewritePattern > pattern)

Register a rewrite pattern with the rewriter.

Rewrite patterns are attempted in the order of registration.

Definition at line 21 of file DIExpressionRewriter.cpp.

Referenced by mlir::LLVM::legalizeDIExpressionsRecursively().

◆ simplify()

DIExpressionAttr DIExpressionRewriter::simplify ( LLVM::DIExpressionAttr expr,
std::optional< uint64_t > maxNumRewrites = {} ) const

Simplify a DIExpression according to all the patterns registered.

An optional maxNumRewrites can be passed to limit the number of rewrites that gets applied.

Definition at line 27 of file DIExpressionRewriter.cpp.

References replacement(), and result.

Referenced by mlir::LLVM::legalizeDIExpressionsRecursively().


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