message: [MLIR:TF] Do not use TF EvaluateOperation to fold function call sites
diff: @@ -18,8 +18,10 @@ limitations under the License.
  #include <algorithm>
  #include "mlir/Interfaces/SideEffects.h" // from @llvm-project
  +#include "mlir/Support/LogicalResult.h" // from @llvm-project
  #include "tensorflow/c/eager/c_api.h"
  #include "tensorflow/c/tf_status.h"
  +#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
  #include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.h"
  #include "tensorflow/compiler/mlir/tensorflow/utils/eval_util.h"
  #include "tensorflow/core/platform/mutex.h"
  @@ -46,6 +48,12 @@ LogicalResult ConstantFoldFallbackHook(
  }
  }
  + // Do not execute function calls.
  + if (llvm::isa<TF::WhileOp>(inst) || llvm::isa<TF::IfOp>(inst) ||
  + llvm::isa<CallOpInterface>(inst)) {
  + return failure();
  + }
  +
  // TODO(jpienaar): Currently this persists the entire program execution. This
  // should instead be per module/set from the Graph being executed in TF (if
  // any) so that the value of variables in the context could be read.
  