@@ -133,7 +133,7 @@ aliasingFuncOpBBArgsAnalysis(FuncOp funcOp, OneShotAnalysisState &state,
133133 }
134134
135135 // Find all func.return ops.
136- SmallVector<func::ReturnOp > returnOps = getReturnOps (funcOp);
136+ SmallVector<Operation * > returnOps = getReturnOps (funcOp);
137137 assert (!returnOps.empty () && " expected at least one ReturnOp" );
138138
139139 // Build alias sets. Merge all aliases from all func.return ops.
@@ -142,7 +142,7 @@ aliasingFuncOpBBArgsAnalysis(FuncOp funcOp, OneShotAnalysisState &state,
142142 int64_t bbArgIdx = bbArg.getArgNumber ();
143143 // Store aliases in a set, so that we don't add the same alias twice.
144144 SetVector<int64_t > aliases;
145- for (func::ReturnOp returnOp : returnOps) {
145+ for (Operation * returnOp : returnOps) {
146146 for (OpOperand &returnVal : returnOp->getOpOperands ()) {
147147 if (isa<RankedTensorType>(returnVal.get ().getType ())) {
148148 int64_t returnIdx = returnVal.getOperandNumber ();
@@ -192,7 +192,7 @@ aliasingFuncOpBBArgsAnalysis(FuncOp funcOp, OneShotAnalysisState &state,
192192 // argument for the i-th operand. In contrast to aliasing information,
193193 // which is just "merged", equivalence information must match across all
194194 // func.return ops.
195- for (func::ReturnOp returnOp : ArrayRef (returnOps).drop_front ()) {
195+ for (Operation * returnOp : ArrayRef (returnOps).drop_front ()) {
196196 std::optional<int64_t > maybeEquiv =
197197 findEquivalentBlockArgIdx (returnOp->getOpOperand (i));
198198 if (maybeEquiv != bbArgIdx) {
@@ -398,7 +398,7 @@ static Value unpackCast(Value v) {
398398// / func.return ops. This function returns as many types as the return ops have
399399// / operands. If the i-th operand is not the same for all func.return ops, then
400400// / the i-th returned type is an "empty" type.
401- static SmallVector<Type> getReturnTypes (SmallVector<func::ReturnOp > returnOps) {
401+ static SmallVector<Type> getReturnTypes (SmallVector<Operation * > returnOps) {
402402 assert (!returnOps.empty () && " expected at least one ReturnOp" );
403403 int numOperands = returnOps.front ()->getNumOperands ();
404404
@@ -434,11 +434,11 @@ static void foldMemRefCasts(func::FuncOp funcOp) {
434434 return ;
435435
436436 // Compute the common result types of all return ops.
437- SmallVector<func::ReturnOp > returnOps = getReturnOps (funcOp);
437+ SmallVector<Operation * > returnOps = getReturnOps (funcOp);
438438 SmallVector<Type> resultTypes = getReturnTypes (returnOps);
439439
440440 // Remove direct casts.
441- for (func::ReturnOp returnOp : returnOps) {
441+ for (Operation * returnOp : returnOps) {
442442 for (OpOperand &operand : returnOp->getOpOperands ()) {
443443 // Bail if no common result type was found.
444444 if (resultTypes[operand.getOperandNumber ()]) {
0 commit comments