<commit_before>// Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "iree/compiler/Dialect/Util/Analysis/Constant/OpOracle.h"

#include "iree/compiler/Dialect/Util/IR/UtilDialect.h"
#include "mlir/Dialect/Linalg/IR/LinalgInterfaces.h"
#include "mlir/Dialect/Linalg/IR/LinalgOps.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"

namespace mlir {
namespace iree_compiler {
namespace IREE {
namespace Util {

void registerConstExprDependentDialects(DialectRegistry &registry) {
  registry.insert<IREE::Util::UtilDialect>();
  registry.insert<linalg::LinalgDialect>();
}

bool isEligibleConstExprOp(Operation *op) {
  // Special carve-out for unregistered testing ops.
  if (!op->isRegistered()) {
    if (op->getName().getStringRef() ==
        "iree_unregistered.non_leaf_const_expr") {
      return true;
    }
    if (op->getName().getStringRef() == "iree_unregistered.const_expr") {
      return true;
    }
    if (op->getName().getStringRef() == "iree_unregistered.var_expr") {
      return false;
    }
    return false;
  }

  // Allow linalg ops, even though they are not effect annotated.
  if (op->getDialect() ==<commit_msg>Fix build break: mid-air collision on a header rename upstream.<commit_after>// Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "iree/compiler/Dialect/Util/Analysis/Constant/OpOracle.h"

#include "iree/compiler/Dialect/Util/IR/UtilDialect.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"

namespace mlir {
namespace iree_compiler {
namespace IREE {
namespace Util {

void registerConstExprDependentDialects(DialectRegistry &registry) {
  registry.insert<IREE::Util::UtilDialect>();
  registry.insert<linalg::LinalgDialect>();
}

bool isEligibleConstExprOp(Operation *op) {
  // Special carve-out for unregistered testing ops.
  if (!op->isRegistered()) {
    if (op->getName().getStringRef() ==
        "iree_unregistered.non_leaf_const_expr") {
      return true;
    }
    if (op->getName().getStringRef() == "iree_unregistered.const_expr") {
      return true;
    }
    if (op->getName().getStringRef() == "iree_unregistered.var_expr") {
      return false;
    }
    return false;
  }

  // Allow linalg ops, even though they are not effect annotated.
  if (op->getDialect() ==
{'fraction_non_alphanumeric': 0.13214013709063213, 'fraction_numerical': 0.006092916984006093, 'mean_word_length': 4.120857699805068, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2649617', 'n_tokens_mistral': 895, 'n_tokens_neox': 876, 'n_words': 181}