33 bool wouldBeCloned)
const final {
34 auto callOp = dyn_cast<func::CallOp>(call);
35 auto funcOp = dyn_cast<func::FuncOp>(callable);
36 return !(callOp && callOp.getNoInline()) &&
37 !(funcOp && funcOp.getNoInline());
58 auto returnOp = dyn_cast<ReturnOp>(op);
64 builder.create<cf::BranchOp>(op->getLoc(), newDest, returnOp.getOperands());
72 auto returnOp = cast<ReturnOp>(op);
75 assert(returnOp.getNumOperands() == valuesToRepl.size());
77 valuesToRepl[it.index()].replaceAllUsesWith(it.value());
88 dialect->addInterfaces<FuncInlinerInterface>();
static bool isLegalToInline(InlinerInterface &interface, Region *src, Region *insertRegion, bool shouldCloneInlinedRegion, IRMapping &valueMapping)
Utility to check that all of the operations within 'src' can be inlined.
Block represents an ordered list of Operations.
This is the interface that must be implemented by the dialects of operations to be inlined.
DialectInlinerInterface(Dialect *dialect)
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
bool addExtension(TypeID extensionID, std::unique_ptr< DialectExtensionBase > extension)
Add the given extension to the registry.
This is a utility class for mapping one set of IR entities to another.
MLIRContext is the top-level object for a collection of MLIR operations.
T * getOrLoadDialect()
Get (or create) a dialect for the given derived dialect type.
This class helps build Operations.
Operation is the basic unit of execution within MLIR.
This class contains a list of basic blocks and a link to the parent operation it is attached to.
This class provides an abstraction over the different types of ranges over Values.
constexpr void enumerate(std::tuple< Tys... > &tuple, CallbackT &&callback)
void registerInlinerExtension(DialectRegistry ®istry)
Register the extension used to support inlining the func dialect.
Include the generated interface declarations.