Updates LLVM usage to match
[e1669843f2aa](https://github.com/llvm/llvm-project/commit/e1669843f2aa)

PiperOrigin-RevId: 331987679
This commit is contained in:
A. Unique TensorFlower 2020-09-16 05:56:43 -07:00 committed by TensorFlow MLIR Team
parent 1800f44a29
commit 1880f87737
10 changed files with 46 additions and 14 deletions

View File

@ -1,2 +1,2 @@
7841e21c98495ba5e33e0d2507d985bd5b938445 e1669843f2aaf1e4929afdd8f125c14536d27664

View File

@ -44,9 +44,15 @@ class HloClientDialect : public Dialect {
static StringRef getDialectNamespace() { return "chlo"; } static StringRef getDialectNamespace() { return "chlo"; }
}; };
} // namespace chlo
} // namespace mlir
#define GET_OP_CLASSES #define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h.inc" #include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h.inc"
namespace mlir {
namespace chlo {
template <typename T> template <typename T>
static Value getConstantLike(OpBuilder& b, Location loc, T constant, static Value getConstantLike(OpBuilder& b, Location loc, T constant,
Value val) { Value val) {

View File

@ -37,7 +37,7 @@ include "mlir-hlo/Dialect/mhlo/IR/infer_fusibility_op_interface.td"
def HLOClient_Dialect : Dialect { def HLOClient_Dialect : Dialect {
let name = "chlo"; let name = "chlo";
let cppNamespace = "chlo"; let cppNamespace = "::mlir::chlo";
let summary = [{ let summary = [{
Client HLO Ops Client HLO Ops
}]; }];

View File

@ -19,7 +19,6 @@ limitations under the License.
#define TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_H_ #define TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_H_
#include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringRef.h"
#include "mlir-hlo/Dialect/mhlo/IR/infer_fusibility_op_interface.h"
#include "mlir/IR/Attributes.h" #include "mlir/IR/Attributes.h"
#include "mlir/IR/Dialect.h" #include "mlir/IR/Dialect.h"
#include "mlir/IR/DialectImplementation.h" #include "mlir/IR/DialectImplementation.h"
@ -32,11 +31,14 @@ limitations under the License.
#include "mlir/Interfaces/InferTypeOpInterface.h" #include "mlir/Interfaces/InferTypeOpInterface.h"
#include "mlir/Interfaces/SideEffectInterfaces.h" #include "mlir/Interfaces/SideEffectInterfaces.h"
// clang-format off
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_structs.h.inc"
#include "mlir-hlo/Dialect/mhlo/IR/infer_fusibility_op_interface.h"
// clang-format on
namespace mlir { namespace mlir {
class OpBuilder; class OpBuilder;
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_structs.h.inc"
namespace mhlo { namespace mhlo {
class MhloDialect : public Dialect { class MhloDialect : public Dialect {
@ -77,10 +79,10 @@ LogicalResult deriveShapeFromFirstOperand(
OpBuilder *builder, Operation *op, OpBuilder *builder, Operation *op,
SmallVectorImpl<Value> *reifiedReturnShapes); SmallVectorImpl<Value> *reifiedReturnShapes);
#define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h.inc"
} // end namespace mhlo } // end namespace mhlo
} // end namespace mlir } // end namespace mlir
#define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h.inc"
#endif // TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_H_ #endif // TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_HLO_OPS_H_

View File

@ -27,7 +27,7 @@ include "mlir-hlo/Dialect/mhlo/IR/infer_fusibility_op_interface.td"
def HLO_Dialect : Dialect { def HLO_Dialect : Dialect {
let name = "mhlo"; let name = "mhlo";
let cppNamespace = "mhlo"; let cppNamespace = "::mlir::mhlo";
} }
class HLO_Op<string mnemonic, list<OpTrait> traits> : class HLO_Op<string mnemonic, list<OpTrait> traits> :

View File

@ -33,9 +33,11 @@ limitations under the License.
namespace mlir { namespace mlir {
class OpBuilder; class OpBuilder;
} // namespace mlir
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops_structs.h.inc" #include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops_structs.h.inc"
namespace mlir {
namespace lmhlo { namespace lmhlo {
class LmhloDialect : public Dialect { class LmhloDialect : public Dialect {
@ -44,10 +46,10 @@ class LmhloDialect : public Dialect {
static StringRef getDialectNamespace() { return "lmhlo"; } static StringRef getDialectNamespace() { return "lmhlo"; }
}; };
#define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h.inc"
} // namespace lmhlo } // namespace lmhlo
} // end namespace mlir } // end namespace mlir
#define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h.inc"
#endif // TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_LHLO_OPS_H_ #endif // TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_IR_LHLO_OPS_H_

View File

@ -41,7 +41,7 @@ include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_base.td"
def LHLO_Dialect : Dialect { def LHLO_Dialect : Dialect {
let name = "lmhlo"; let name = "lmhlo";
let cppNamespace = "lmhlo"; let cppNamespace = "::mlir::lmhlo";
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@ -303,9 +303,15 @@ void ConstantLikeOp::getCanonicalizationPatterns(
results.insert<ConstantLikeToConstant>(context); results.insert<ConstantLikeToConstant>(context);
} }
} // namespace chlo
} // namespace mlir
#define GET_OP_CLASSES #define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.cc.inc" #include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.cc.inc"
namespace mlir {
namespace chlo {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// chlo Dialect Constructor // chlo Dialect Constructor
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@ -60,7 +60,11 @@ limitations under the License.
namespace mlir { namespace mlir {
#include "hlo_patterns.cc.inc" #include "hlo_patterns.cc.inc"
} // namespace mlir
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_structs.cc.inc" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops_structs.cc.inc"
namespace mlir {
namespace mhlo { namespace mhlo {
Operation* MhloDialect::materializeConstant(OpBuilder& builder, Attribute value, Operation* MhloDialect::materializeConstant(OpBuilder& builder, Attribute value,
@ -2469,9 +2473,15 @@ void CompareOp::build(OpBuilder& builder, OperationState& result, Value lhs,
build(builder, result, new_type, lhs, rhs, comparison_direction); build(builder, result, new_type, lhs, rhs, comparison_direction);
} }
} // namespace mhlo
} // namespace mlir
#define GET_OP_CLASSES #define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.cc.inc" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.cc.inc"
namespace mlir {
namespace mhlo {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// mhlo Dialect Interfaces // mhlo Dialect Interfaces
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@ -29,6 +29,7 @@ limitations under the License.
#include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringRef.h"
#include "llvm/Support/FormatVariadic.h" #include "llvm/Support/FormatVariadic.h"
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h.inc" #include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h.inc"
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops_structs.cc.inc"
#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/Attributes.h" #include "mlir/IR/Attributes.h"
#include "mlir/IR/Builders.h" #include "mlir/IR/Builders.h"
@ -46,7 +47,6 @@ limitations under the License.
#include "mlir/IR/Value.h" #include "mlir/IR/Value.h"
namespace mlir { namespace mlir {
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops_structs.cc.inc"
namespace lmhlo { namespace lmhlo {
LmhloDialect::LmhloDialect(MLIRContext *context) LmhloDialect::LmhloDialect(MLIRContext *context)
@ -159,9 +159,15 @@ static LogicalResult Verify(ReshapeMemRefCastOp op) {
return success(); return success();
} }
} // namespace lmhlo
} // namespace mlir
#define GET_OP_CLASSES #define GET_OP_CLASSES
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.cc.inc" #include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.cc.inc"
namespace mlir {
namespace lmhlo {
// TODO(cheshire): Support folding, reuse code from hlo_ops.cc. // TODO(cheshire): Support folding, reuse code from hlo_ops.cc.
void FusionOp::build(OpBuilder &builder, OperationState &result, void FusionOp::build(OpBuilder &builder, OperationState &result,