forked from OSchip/llvm-project
Restrict affine inlining to just Function operations.
The current restrictions on dim/symbols require a top-level symbol for the conservative case of a non-affine region. This should be relaxed in the future. PiperOrigin-RevId: 267641838
This commit is contained in:
parent
8154370b49
commit
b78410fd81
|
@ -59,10 +59,12 @@ struct AffineInlinerInterface : public DialectInlinerInterface {
|
|||
/// dialect, can be inlined into the given region, false otherwise.
|
||||
bool isLegalToInline(Operation *op, Region *region,
|
||||
BlockAndValueMapping &valueMapping) const final {
|
||||
// Always allow inlining affine operations. There are some edge cases when
|
||||
// inlining *into* affine structures, but that is handled in the other
|
||||
// 'isLegalToInline' hook above.
|
||||
return true;
|
||||
// Always allow inlining affine operations into the top-level region of a
|
||||
// function. There are some edge cases when inlining *into* affine
|
||||
// structures, but that is handled in the other 'isLegalToInline' hook
|
||||
// above.
|
||||
// TODO: We should be able to inline into other regions than functions.
|
||||
return isa<FuncOp>(region->getParentOp());
|
||||
}
|
||||
|
||||
/// Affine regions should be analyzed recursively.
|
||||
|
|
Loading…
Reference in New Issue