Lines Matching +defs:region +defs:end

45 /// `region` or is an argument of `region`. A value of index type defined at the
46 /// top level of a `AffineScope` region is always a valid symbol for all
47 /// uses in that region.
48 bool mlir::affine::isTopLevelValue(Value value, Region *region) {
50 return arg.getParentRegion() == region;
51 return value.getDefiningOp()->getParentRegion() == region;
55 /// region remains legal if the operation that uses it is inlined into `dest`
72 // inlining is a valid dimension in the new region.
76 // If it's a top-level value because it's defined in the region,
155 /// Returns true if the given region 'src' can be inlined into the region
157 /// 'wouldBeCloned' is set if the region is cloned into its new location
182 // Assuming the inlined region is valid, we only need to check if the
203 /// dialect, can be inlined into the given region, false otherwise.
204 bool isLegalToInline(Operation *op, Region *region, bool wouldBeCloned,
206 // Always allow inlining affine operations into a region that is marked as
210 Operation *parentOp = region->getParentOp();
245 /// op with trait `AffineScope`. If the value is defined in an unlinked region,
251 // region has not yet been attached to an Op, at which point the parent Op
261 /// Returns the closest region enclosing `op` that is held by an operation with
262 /// trait `AffineScope`; `nullptr` if there is no such region.
298 bool mlir::affine::isValidDim(Value value, Region *region) {
304 if (isValidSymbol(value, region))
317 return applyOp.isValidDim(region);
327 /// for `region`.
330 Region *region) {
344 region);
347 /// Returns true if the result of the dim op is a valid symbol for `region`.
348 static bool isDimOpValidSymbol(ShapedDimOpInterface dimOp, Region *region) {
380 [&](auto op) { return isMemRefSizeValidSymbol(op, i, region); })
410 /// A value can be used as a symbol for `region` iff it meets one of the
417 /// *) It is defined at the top level of 'region' or is its argument.
418 /// *) It dominates `region`'s parent op.
419 /// If `region` is null, conservatively assume the symbol definition scope does
421 /// the surrounding region structure, i.e. the first three cases above.
422 bool mlir::affine::isValidSymbol(Value value, Region *region) {
428 if (region && ::isTopLevelValue(value, region))
434 // dominates region's parent op.
435 Operation *regionOp = region ? region->getParentOp() : nullptr;
437 if (auto *parentOpRegion = region->getParentOp()->getParentRegion())
449 return affine::isValidSymbol(operand, region);
456 return isDimOpValidSymbol(dimOp, region);
458 // Check for values dominating `region`'s parent op.
459 Operation *regionOp = region ? region->getParentOp() : nullptr;
461 if (auto *parentRegion = region->getParentOp()->getParentRegion())
469 // `region` provides the polyhedral symbol scope. Returns false otherwise.
470 static bool isValidAffineIndexOperand(Value value, Region *region) {
471 return isValidDim(value, region) || isValidSymbol(value, region);
476 Operation::operand_iterator end,
478 OperandRange operands(begin, end);
582 // its operands are valid dimension ids with the parent operation of `region`
584 bool AffineApplyOp::isValidDim(Region *region) {
586 [&](Value op) { return ::isValidDim(op, region); });
596 // The result of the affine apply operation can be used as a symbol in `region`
597 // if all its operands are symbols in `region`.
598 bool AffineApplyOp::isValidSymbol(Region *region) {
600 return affine::isValidSymbol(operand, region);
1052 affineApply.getMapOperands().end());
1066 dims.append(composeDims.begin(), composeDims.end());
1067 syms.append(composeSyms.begin(), composeSyms.end());
1088 operands->end());
1177 SmallVector<Value> submapOperands(operands.begin(), operands.end());
1352 resultOperands.append(remappedSymbols.begin(), remappedSymbols.end());
1398 if (it == seenDims.end()) {
1425 if (it == seenSymbols.end()) {
1477 if (map == oldMap && std::equal(oldOperands.begin(), oldOperands.end(),
1855 // Create a region and a block for the body. The argument of the region is
2084 // Parse the body region.
2136 printDimAndSymbolList(boundOperands.begin(), boundOperands.end(),
2303 if (iterArgIt == iterArgs.end()) {
2337 assert((point.isParent() || point == getRegion()) && "invalid region point");
2346 assert((point.isParent() || point == getRegion()) && "expected loop region");
2392 results.assign(getInits().begin(), getInits().end());
2501 inits.append(newInitOperands.begin(), newInitOperands.end());
2737 // The absence, or equivalently, the emptiness of the else region need not
2739 // operation is returning results, it always has a non-empty else region.
2741 // If the else region is absent, or equivalently, empty, remove the
2777 // `else` region is valid.
2782 // If the "else" region is empty, branch bach into parent.
2792 // If the predecessor is the `else`/`then` region, then branching into parent
2849 // Parse the 'then' region.
2855 // If we find an 'else' keyword then parse the 'else' region.
3292 if (resultIt == results.end())
3398 newDimOperands.append(dimValues.begin(), dimValues.end());
3399 newSymOperands.append(symValues.begin(), symValues.end());
3447 flattener.operandExprStack.back().end());
3759 // Create a region and a block for the body.
3831 return OpBuilder(getBody(), std::prev(getBody()->end()));
3841 newOperands.append(ubOperands.begin(), ubOperands.end());
3852 newOperands.append(ubOperands.begin(), ubOperands.end());
3910 return emitOpError() << "the number of region arguments ("
4197 result.operands.append(dimOperands.begin(), dimOperands.end());
4198 result.operands.append(symOperands.begin(), symOperands.end());
4213 // `to` parallel-bound steps? region attr-dict?
4651 std::reverse(result.begin(), result.end());
4730 /// disjoint` and the two operations end with the same basis elements,
4788 linearizeIns.take_back(numMatches).end());