MLIR  20.0.0git
Classes | Public Types | Public Member Functions | List of all members
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. More...
 
LLVM::DIExpressionAttr simplify (LLVM::DIExpressionAttr expr, std::optional< uint64_t > maxNumRewrites={}) const
 Simplify a DIExpression according to all the patterns registered. More...
 

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 22 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 28 of file DIExpressionRewriter.cpp.

References mlir::get().

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


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