mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
[MLIR][Affine] Expose getAffineScope as a utility function
The getAffineScope function is currently internal to AffineOps.cpp. However, as the comment on the function itself notes, this is useful in a variety of other places externally. This PR allows other files to use the function. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D121827
This commit is contained in:
parent
6dd21d1db1
commit
97eedc7443
@ -32,6 +32,10 @@ class AffineValueMap;
|
||||
/// uses.
|
||||
bool isTopLevelValue(Value value);
|
||||
|
||||
/// Returns the closest region enclosing `op` that is held by an operation with
|
||||
/// trait `AffineScope`; `nullptr` if there is no such region.
|
||||
Region *getAffineScope(Operation *op);
|
||||
|
||||
/// AffineDmaStartOp starts a non-blocking DMA operation that transfers data
|
||||
/// from a source memref to a destination memref. The source and destination
|
||||
/// memref need not be of the same dimensionality, but need to have the same
|
||||
|
@ -244,8 +244,7 @@ bool mlir::isTopLevelValue(Value value) {
|
||||
|
||||
/// Returns the closest region enclosing `op` that is held by an operation with
|
||||
/// trait `AffineScope`; `nullptr` if there is no such region.
|
||||
// TODO: getAffineScope should be publicly exposed for affine passes/utilities.
|
||||
static Region *getAffineScope(Operation *op) {
|
||||
Region *mlir::getAffineScope(Operation *op) {
|
||||
auto *curOp = op;
|
||||
while (auto *parentOp = curOp->getParentOp()) {
|
||||
if (parentOp->hasTrait<OpTrait::AffineScope>())
|
||||
|
Loading…
x
Reference in New Issue
Block a user