Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3085,8 +3085,8 @@ std::pair<unsigned, unsigned> AsyncExecuteOp::getTiedResultsIndexAndLength() {
}

OperandRange
AsyncExecuteOp::getEntrySuccessorOperands(RegionBranchPoint point) {
assert(point.getRegionOrNull() == &getBody() && "invalid region index");
AsyncExecuteOp::getEntrySuccessorOperands(RegionSuccessor successor) {
assert(successor.getSuccessor() == &getBody() && "invalid region index");
return getResourceOperands();
}

Expand All @@ -3096,7 +3096,7 @@ void AsyncExecuteOp::getSuccessorRegions(
// return the correct RegionSuccessor purely based on the index being None or
// 0.
if (!point.isParent()) {
regions.push_back(RegionSuccessor(getResults()));
regions.push_back(RegionSuccessor(getOperation(), getResults()));
} else {
regions.push_back(RegionSuccessor(&getBody(), getBody().getArguments()));
}
Expand Down Expand Up @@ -3240,8 +3240,8 @@ LogicalResult AsyncConcurrentOp::verify() {
}

OperandRange
AsyncConcurrentOp::getEntrySuccessorOperands(RegionBranchPoint point) {
assert(point == &getBody() && "invalid region index");
AsyncConcurrentOp::getEntrySuccessorOperands(RegionSuccessor successor) {
assert(successor.getSuccessor() == &getBody() && "invalid region index");
return getResourceOperands();
}

Expand All @@ -3251,7 +3251,7 @@ void AsyncConcurrentOp::getSuccessorRegions(
// return the correct RegionSuccessor purely based on the index being None or
// 0.
if (!point.isParent()) {
regions.push_back(RegionSuccessor(getResults()));
regions.push_back(RegionSuccessor(getOperation(), getResults()));
} else {
regions.push_back(RegionSuccessor(&getBody(), getBody().getArguments()));
}
Expand Down Expand Up @@ -4049,8 +4049,9 @@ LogicalResult CmdExecuteOp::verify() {
return success();
}

OperandRange CmdExecuteOp::getEntrySuccessorOperands(RegionBranchPoint point) {
assert(point == &getBody() && "invalid region index");
OperandRange
CmdExecuteOp::getEntrySuccessorOperands(RegionSuccessor successor) {
assert(successor.getSuccessor() == &getBody() && "invalid region index");
return getResourceOperands();
}

Expand All @@ -4060,7 +4061,8 @@ void CmdExecuteOp::getSuccessorRegions(
// return the correct RegionSuccessor purely based on the index being None or
// 0.
if (!point.isParent()) {
regions.push_back(RegionSuccessor({}));
regions.push_back(
RegionSuccessor(getOperation(), Operation::result_range(nullptr, 0)));
} else {
regions.push_back(RegionSuccessor(&getBody(), getBody().getArguments()));
}
Expand Down Expand Up @@ -4130,7 +4132,8 @@ void CmdSerialOp::getSuccessorRegions(
// return the correct RegionSuccessor purely based on the index being None or
// 0.
if (!point.isParent()) {
regions.push_back(RegionSuccessor({}));
regions.push_back(
RegionSuccessor(getOperation(), Operation::result_range(nullptr, 0)));
} else {
regions.push_back(RegionSuccessor(&getBody(), {}));
}
Expand All @@ -4155,7 +4158,8 @@ void CmdConcurrentOp::getSuccessorRegions(
// return the correct RegionSuccessor purely based on the index being None or
// 0.
if (!point.isParent()) {
regions.push_back(RegionSuccessor({}));
regions.push_back(
RegionSuccessor(getOperation(), Operation::result_range(nullptr, 0)));
} else {
regions.push_back(RegionSuccessor(&getBody(), {}));
}
Expand Down Expand Up @@ -4426,7 +4430,7 @@ LogicalResult DispatchWorkgroupSizeOp::verify() {
//===----------------------------------------------------------------------===//

MutableOperandRange
YieldOp::getMutableSuccessorOperands(RegionBranchPoint point) {
YieldOp::getMutableSuccessorOperands(RegionSuccessor successor) {
return getResourceOperandsMutable();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ static IREE::Stream::AffinityAttr findLocalValueAffinity(Value value) {
auto terminatorOp =
cast<RegionBranchTerminatorOpInterface>(block.getTerminator());
value = terminatorOp.getSuccessorOperands(
RegionBranchPoint::parent())[resultIndex];
RegionSuccessor(definingOp, definingOp->getResults()))[resultIndex];
} else if (auto tiedOp =
dyn_cast<IREE::Util::TiedOpInterface>(definingOp)) {
// If the producer is tied then try to get the operand.
Expand Down
11 changes: 6 additions & 5 deletions compiler/src/iree/compiler/Dialect/Util/Analysis/Explorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ TraversalResult Explorer::walkReturnOperands(Operation *parentOp,
return walkReturnOps(parentOp, [&](Operation *returnOp) {
if (auto terminatorOp =
dyn_cast<RegionBranchTerminatorOpInterface>(returnOp)) {
return fn(terminatorOp.getSuccessorOperands(RegionBranchPoint::parent()));
return fn(terminatorOp.getSuccessorOperands(
RegionSuccessor(parentOp, parentOp->getResults())));
} else {
return fn(returnOp->getOperands());
}
Expand Down Expand Up @@ -992,8 +993,9 @@ TraversalResult Explorer::walkTransitiveUses(Value value, UseWalkFn fn,
// Move within/out-of a region.
auto traverseRegionBranchOp = [&](RegionBranchTerminatorOpInterface branchOp,
unsigned operandIdx) {
auto successorOperands =
branchOp.getSuccessorOperands(RegionBranchPoint::parent());
Operation *parentOp = branchOp.getOperation()->getParentOp();
auto successorOperands = branchOp.getSuccessorOperands(
RegionSuccessor(parentOp, parentOp->getResults()));
unsigned beginIdx = successorOperands.getBeginOperandIndex();
if (operandIdx < beginIdx ||
operandIdx >= beginIdx + successorOperands.size()) {
Expand All @@ -1003,8 +1005,7 @@ TraversalResult Explorer::walkTransitiveUses(Value value, UseWalkFn fn,
<< operandIdx << "\n");
return TraversalResult::COMPLETE;
}
auto result = branchOp.getSuccessorOperands(
RegionBranchPoint::parent())[operandIdx - beginIdx];
auto result = successorOperands[operandIdx - beginIdx];
LLVM_DEBUG({
llvm::dbgs() << " + queuing region result ";
result.printAsOperand(llvm::dbgs(), asmState);
Expand Down
2 changes: 1 addition & 1 deletion third_party/llvm-project
Submodule llvm-project updated 38 files
+4 −3 flang/lib/Optimizer/Dialect/FIROps.cpp
+3 −3 mlir/include/mlir/Analysis/DataFlow/DenseAnalysis.h
+1 −1 mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
+7 −0 mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
+3 −3 mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
+1 −1 mlir/include/mlir/Dialect/Transform/TuneExtension/TuneExtensionOps.td
+2 −0 mlir/include/mlir/IR/Diagnostics.h
+1 −0 mlir/include/mlir/IR/Operation.h
+2 −0 mlir/include/mlir/IR/Region.h
+66 −38 mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
+91 −17 mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
+222 −103 mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
+4 −5 mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
+3 −1 mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
+3 −3 mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
+1 −1 mlir/lib/Analysis/SliceWalk.cpp
+29 −21 mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+7 −4 mlir/lib/Dialect/Async/IR/Async.cpp
+7 −4 mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
+5 −3 mlir/lib/Dialect/EmitC/IR/EmitC.cpp
+1 −1 mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
+1 −1 mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
+30 −22 mlir/lib/Dialect/SCF/IR/SCF.cpp
+0 −1 mlir/lib/Dialect/SCF/Transforms/ForToWhile.cpp
+0 −1 mlir/lib/Dialect/SCF/Transforms/ForallToFor.cpp
+1 −1 mlir/lib/Dialect/Shape/IR/Shape.cpp
+2 −2 mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
+22 −15 mlir/lib/Dialect/Transform/IR/TransformOps.cpp
+3 −2 mlir/lib/Dialect/Transform/TuneExtension/TuneExtensionOps.cpp
+4 −0 mlir/lib/IR/Diagnostics.cpp
+15 −0 mlir/lib/IR/Region.cpp
+217 −88 mlir/lib/Interfaces/ControlFlowInterfaces.cpp
+18 −7 mlir/lib/Transforms/RemoveDeadValues.cpp
+4 −4 mlir/test/Dialect/SCF/invalid.mlir
+2 −2 mlir/test/lib/Analysis/DataFlow/TestDenseBackwardDataFlowAnalysis.cpp
+14 −12 mlir/test/lib/Dialect/Test/TestOpDefs.cpp
+1 −1 mlir/test/lib/Dialect/Test/TestOps.td
+31 −7 mlir/unittests/Interfaces/ControlFlowInterfacesTest.cpp
2 changes: 1 addition & 1 deletion third_party/torch-mlir
Loading