14#include "../EmissionPrinter.h"
34 if (value.getDefiningOp<ConstantOp>())
40 p.
emitAttr(value.getDefiningOp<ConstantOp>().getValueAttr());
50 MLIRContext *context) {
51 patterns.add<ConstantEmitter>(context);
This class collects a set of emission patterns with base type 'PatternTy'.
This is intended to be the driving class for all pattern-based IR emission.
void emitAttr(Attribute attr)
Emit the given attribute to the ostream associated with this printer according to the emission patter...
This class allows a pattern's match function for inlining to pass its result's precedence to the patt...
void populateHWEmitters(OpEmissionPatternSet &patterns, MLIRContext *context)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
This is a convenience class providing default implementations for operation emission patterns.
OpEmissionPattern(MLIRContext *context)
void emitInlined(mlir::Value value, EmissionPrinter &p) override
Emit the expression for the given value.
MatchResult matchInlinable(Value value) override
Checks if this pattern is applicable to the given value to emit an inlinable expression.