message: Skip trying to refine ops with large number of result ops for now.
  This results in a blow up due to uniquing tuple types intermediate values.
diff: @@ -1524,6 +1524,9 @@ void ShapeInference::InferShapeForFunctionReturnType(FuncOp func) {
  LogicalResult ShapeInference::InferShapeUntilFixPoint(Region* region,
  int64_t max_iteration) {
  bool changed = true;
  + // TODO(b/180630087): This is due to creating needless intermediate types
  + // which can be really expensive given the current approach here.
  + bool failed_due_inefficiency = false;
  // TODO(aminim): we could have a more efficient traversal by guiding the
  // traversal with a worklist and reconsider only the nodes for which an
  @@ -1534,6 +1537,12 @@ LogicalResult ShapeInference::InferShapeUntilFixPoint(Region* region,
  LLVM_DEBUG(llvm::dbgs()
  << "Shape inference, iteration " << iteration << "\n");
  region->walk([&](Operation* op) {
  + // TODO(b/180630087): Remove post change.
  + if (op->getNumResults() > 50e3) {
  + failed_due_inefficiency = true;
  + return;
  + }
  +
  DCOMMENT_OP(op, "Inferring for");
  if (auto infer_ti = dyn_cast<InferTypeOpInterface>(op)) {
  DCOMMENT("\tRefinining with type op interface");
  @@ -1569,6 +1578,11 @@ LogicalResult ShapeInference::InferShapeUntilFixPoint(Region* region,
  changed |= InferShapeForSingleOperation(op);
  });
  +
  + if (failed_due_inefficiency) {
  + LOG(ERROR) << "skipped inference due to b/180029566";
  + return failure();
  + }
  }
  if (changed) {
  