Args: ./tf-opt -tf-to-hlo-pipeline --debug --print-ir-after-all ./test.tf_dialect.mlir -o ./test.mhlo.mlir
Load new dialect in Context
Load new dialect in Context acc
Load new dialect in Context affine
Load new dialect in Context arm_neon
Load new dialect in Context arm_sve
Load new dialect in Context async
Load new dialect in Context avx512
Load new dialect in Context chlo
Load new dialect in Context complex
Load new dialect in Context gpu
Load new dialect in Context linalg
Load new dialect in Context std
Load new dialect in Context tensor
Load new dialect in Context llvm
Load new dialect in Context llvm_arm_sve
Load new dialect in Context lmhlo
Load new dialect in Context lmhlo_gpu
Load new dialect in Context math
Load new dialect in Context mhlo
Load new dialect in Context nvvm
Load new dialect in Context omp
Load new dialect in Context pdl
Load new dialect in Context pdl_interp
Load new dialect in Context quant
Load new dialect in Context rocdl
Load new dialect in Context scf
Load new dialect in Context sdbm
Load new dialect in Context shape
Load new dialect in Context spv
Load new dialect in Context tf
Load new dialect in Context tf_device
Load new dialect in Context tf_executor
Load new dialect in Context tf_framework
Load new dialect in Context tf_saved_model
Load new dialect in Context tfl
Load new dialect in Context tosa
Load new dialect in Context vector
// *** IR Dump After FunctionalControlFlowToRegionsPass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {device = "", value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
2021-03-16 14:22:25.753208: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE3 SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
// *** IR Dump After Canonicalizer ***
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
// *** IR Dump After Inliner ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After mlir::TF::{anonymous}::DropWhileShapeInvariantPass ***
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
// *** IR Dump After Canonicalizer ***
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
// *** IR Dump After SCCP ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After mlir::TF::{anonymous}::GuaranteeAllFuncsOneUse ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
Skipping inference; Internal: Missing 'tf.versions' attribute on the module, abort.
// *** IR Dump After TensorFlowShapeInferencePass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After SCCP ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After mlir::{anonymous}::TensorListOpsDecompositionPass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After mlir::{anonymous}::StackOpsDecompositionPass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After mlir::{anonymous}::TensorArrayOpsDecompositionPass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After mlir::TFDevice::{anonymous}::DecomposeResourceOps ***
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
// *** IR Dump After mlir::TF::{anonymous}::PromoteResourcesToArgsPass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After SymbolDCE ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
Skipping inference; Internal: Missing 'tf.versions' attribute on the module, abort.
// *** IR Dump After TensorFlowShapeInferencePass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After RegionControlFlowToFunctionalPass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
// *** IR Dump After mlir::mhlo::{anonymous}::LegalizeTFControlFlow ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
//===-------------------------------------------===//
Legalizing operation : 'module'(0x557512fd83d0) {
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'func'(0x557512fd79e0) {
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tf.Const'(0x5575130b28f0) {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tf.Reshape'(0x55751305f860) {
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tf.Mul'(0x557513060e30) {
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'std.return'(0x557513062460) {
"std.return"(%2) : (tensor<?xi32>) -> ()
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'module_terminator'(0x557513050e10) {
"module_terminator"() : () -> ()
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
// *** IR Dump After LegalizeTfTypesPass ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
%1 = "tf.Reshape"(%arg0, %0) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%2 = "tf.Mul"(%1, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
return %2 : tensor<?xi32>
}
}
//===-------------------------------------------===//
Legalizing operation : 'func'(0x557512fd79e0) {
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'func -> ()' {
} -> FAILURE : pattern failed to match
} -> FAILURE : no matched legalization pattern
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tf.Const'(0x5575130b28f0) {
%0 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'tf.Const -> (mhlo.constant, tensor.cast)' {
** Insert : 'mhlo.constant'(0x5575130d0ac0)
** Insert : 'tensor.cast'(0x5575130b0b30)
** Replace : 'tf.Const'(0x5575130b28f0)
//===-------------------------------------------===//
Legalizing operation : 'mhlo.constant'(0x5575130d0ac0) {
%0 = "mhlo.constant"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tensor.cast'(0x5575130b0b30) {
%1 = "tensor.cast"(%0) : (tensor<1xi32>) -> tensor<1xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
} -> SUCCESS : pattern applied successfully
} -> SUCCESS
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tf.Reshape'(0x55751305f860) {
%3 = "tf.Reshape"(%arg0, %2) {device = ""} : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'tf.Reshape -> ()' {
** Insert : 'mhlo.dynamic_reshape'(0x5575130d08c0)
** Replace : 'tf.Reshape'(0x55751305f860)
//===-------------------------------------------===//
Legalizing operation : 'mhlo.dynamic_reshape'(0x5575130d08c0) {
%3 = "mhlo.dynamic_reshape"(%arg0, %2) : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
} -> SUCCESS : pattern applied successfully
} -> SUCCESS
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tf.Mul'(0x557513060e30) {
%5 = "tf.Mul"(%4, %arg1) {device = ""} : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'tf.Mul -> (chlo.broadcast_multiply)' {
** Insert : 'chlo.broadcast_multiply'(0x5575130d09a0)
** Replace : 'tf.Mul'(0x557513060e30)
//===-------------------------------------------===//
Legalizing operation : 'chlo.broadcast_multiply'(0x5575130d09a0) {
%5 = "chlo.broadcast_multiply"(%4, %arg1) : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
* Fold {
} -> FAILURE : unable to fold
* Pattern : 'chlo.broadcast_multiply -> ()' {
} -> FAILURE : pattern failed to match
* Pattern : 'chlo.broadcast_multiply -> ()' {
** Insert : 'shape.shape_of'(0x5575130d67c0)
** Insert : 'shape.shape_of'(0x5575130d68a0)
** Insert : 'shape.cstr_broadcastable'(0x5575130b24e0)
** Insert : 'shape.assuming'(0x55751306a960)
** Insert : 'shape.shape_of'(0x5575130b25e0)
** Insert : 'shape.shape_of'(0x5575130b2700)
** Insert : 'shape.broadcast'(0x5575130b2790)
** Insert : 'tensor.cast'(0x5575130b2840)
** Insert : 'mhlo.dynamic_broadcast_in_dim'(0x5575130d1e50)
** Insert : 'mhlo.dynamic_broadcast_in_dim'(0x5575130d1f00)
** Insert : 'mhlo.multiply'(0x5575130d58c0)
** Insert : 'shape.assuming_yield'(0x557513092440)
** Replace : 'chlo.broadcast_multiply'(0x5575130d09a0)
//===-------------------------------------------===//
Legalizing operation : 'shape.shape_of'(0x5575130d67c0) {
%5 = "shape.shape_of"(%3) : (tensor<?xi32>) -> tensor<?xindex>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'shape.shape_of'(0x5575130d68a0) {
%6 = "shape.shape_of"(%arg1) : (tensor<?xi32>) -> tensor<?xindex>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'shape.cstr_broadcastable'(0x5575130b24e0) {
%7 = "shape.cstr_broadcastable"(%5, %6) : (tensor<?xindex>, tensor<?xindex>) -> !shape.witness
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'shape.assuming'(0x55751306a960) {
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'shape.shape_of'(0x5575130b25e0) {
%11 = "shape.shape_of"(%3) : (tensor<?xi32>) -> tensor<?xindex>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'shape.shape_of'(0x5575130b2700) {
%12 = "shape.shape_of"(%arg1) : (tensor<?xi32>) -> tensor<?xindex>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'shape.broadcast'(0x5575130b2790) {
%13 = "shape.broadcast"(%11, %12) : (tensor<?xindex>, tensor<?xindex>) -> tensor<?xindex>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'tensor.cast'(0x5575130b2840) {
%14 = "tensor.cast"(%13) : (tensor<?xindex>) -> tensor<1xindex>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'mhlo.dynamic_broadcast_in_dim'(0x5575130d1e50) {
%15 = "mhlo.dynamic_broadcast_in_dim"(%3, %14) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<?xi32>, tensor<1xindex>) -> tensor<?xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'mhlo.dynamic_broadcast_in_dim'(0x5575130d1f00) {
%16 = "mhlo.dynamic_broadcast_in_dim"(%arg1, %14) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<?xi32>, tensor<1xindex>) -> tensor<?xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'mhlo.multiply'(0x5575130d58c0) {
%17 = "mhlo.multiply"(%15, %16) : (tensor<?xi32>, tensor<?xi32>) -> tensor<?xi32>
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'shape.assuming_yield'(0x557513092440) {
"shape.assuming_yield"(%17) : (tensor<?xi32>) -> ()
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
} -> SUCCESS : pattern applied successfully
} -> SUCCESS
//===-------------------------------------------===//
} -> SUCCESS : pattern applied successfully
} -> SUCCESS
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'std.return'(0x557513062460) {
"std.return"(%10) : (tensor<?xi32>) -> ()
} -> SUCCESS : operation marked legal by the target
//===-------------------------------------------===//
// *** IR Dump After mlir::mhlo::{anonymous}::LegalizeTF ***
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = mhlo.constant dense<-1> : tensor<1xi32>
%1 = tensor.cast %0 : tensor<1xi32> to tensor<1xi32>
%2 = "mhlo.dynamic_reshape"(%arg0, %1) : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%3 = shape.shape_of %2 : tensor<?xi32> -> tensor<?xindex>
%4 = shape.shape_of %arg1 : tensor<?xi32> -> tensor<?xindex>
%5 = shape.cstr_broadcastable %3, %4 : tensor<?xindex>, tensor<?xindex>
%6 = shape.assuming %5 -> (tensor<?xi32>) {
%7 = shape.shape_of %2 : tensor<?xi32> -> tensor<?xindex>
%8 = shape.shape_of %arg1 : tensor<?xi32> -> tensor<?xindex>
%9 = shape.broadcast %7, %8 : tensor<?xindex>, tensor<?xindex> -> tensor<?xindex>
%10 = tensor.cast %9 : tensor<?xindex> to tensor<1xindex>
%11 = "mhlo.dynamic_broadcast_in_dim"(%2, %10) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<?xi32>, tensor<1xindex>) -> tensor<?xi32>
%12 = "mhlo.dynamic_broadcast_in_dim"(%arg1, %10) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<?xi32>, tensor<1xindex>) -> tensor<?xi32>
%13 = mhlo.multiply %11, %12 : tensor<?xi32>
shape.assuming_yield %13 : tensor<?xi32>
}
return %6 : tensor<?xi32>
}
// *** IR Dump After mlir::mhlo::{anonymous}::LegalizeTFCommunication ***
module {
func @main(%arg0: tensor<?xi32>, %arg1: tensor<?xi32>) -> tensor<?xi32> {
%0 = mhlo.constant dense<-1> : tensor<1xi32>
%1 = tensor.cast %0 : tensor<1xi32> to tensor<1xi32>
%2 = "mhlo.dynamic_reshape"(%arg0, %1) : (tensor<?xi32>, tensor<1xi32>) -> tensor<?xi32>
%3 = shape.shape_of %2 : tensor<?xi32> -> tensor<?xindex>
%4 = shape.shape_of %arg1 : tensor<?xi32> -> tensor<?xindex>
%5 = shape.cstr_broadcastable %3, %4 : tensor<?xindex>, tensor<?xindex>
%6 = shape.assuming %5 -> (tensor<?xi32>) {
%7 = shape.shape_of %2 : tensor<?xi32> -> tensor<?xindex>
%8 = shape.shape_of %arg1 : tensor<?xi32> -> tensor<?xindex>
%9 = shape.broadcast %7, %8 : tensor<?xindex>, tensor<?xindex> -> tensor<?xindex>
%10 = tensor.cast %9 : tensor<?xindex> to tensor<1xindex>
%11 = "mhlo.dynamic_broadcast_in_dim"(%2, %10) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<?xi32>, tensor<1xindex>) -> tensor<?xi32>
%12 = "mhlo.dynamic_broadcast_in_dim"(%arg1, %10) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<?xi32>, tensor<1xindex>) -> tensor<?xi32>
%13 = mhlo.multiply %11, %12 : tensor<?xi32>
shape.assuming_yield %13 : tensor<?xi32>
}
return %6 : tensor<?xi32>
}
}
tf-opt: external/llvm-project/mlir/include/mlir/IR/BuiltinAttributes.h:581: llvm::iterator_range<mlir::DenseElementsAttr::ElementIterator<T> > mlir::DenseElementsAttr::getValues() const [with T = long int; <template-parameter-1-2> = void]: Assertion `isValidIntOrFloat(sizeof(T), std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed)' failed.
Stack dump:
0. Program arguments: ./tf-opt -tf-to-hlo-pipeline --debug --print-ir-after-all ./test.tf_dialect.mlir -o ./test.mhlo.mlir
1. Program arguments: ./tf-opt -tf-to-hlo-pipeline --debug --print-ir-after-all ./test.tf_dialect.mlir -o ./test.mhlo.mlir
2. Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
./tf-opt(+0xaedf1e3)[0x55750b0ff1e3]
./tf-opt(+0xaedd32d)[0x55750b0fd32d]
./tf-opt(+0xaedd4bc)[0x55750b0fd4bc]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f9b597cf980]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f9b591f2fb7]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f9b591f4921]
/lib/x86_64-linux-gnu/libc.so.6(+0x3048a)[0x7f9b591e448a]
/lib/x86_64-linux-gnu/libc.so.6(+0x30502)[0x7f9b591e4502]
./tf-opt(+0x8287d03)[0x5575084a7d03]
./tf-opt(+0x82a8c02)[0x5575084c8c02]
./tf-opt(+0xa9c3e3a)[0x55750abe3e3a]
./tf-opt(+0xa9c7ac5)[0x55750abe7ac5]
./tf-opt(+0xadec1f9)[0x55750b00c1f9]
./tf-opt(+0xaa859ec)[0x55750aca59ec]
./tf-opt(+0xaa865fd)[0x55750aca65fd]
./tf-opt(+0xaa80a3a)[0x55750aca0a3a]
./tf-opt(+0xad46fa3)[0x55750af66fa3]
./tf-opt(+0xad47662)[0x55750af67662]
./tf-opt(+0xad47fc8)[0x55750af67fc8]
./tf-opt(+0xad464b1)[0x55750af664b1]
./tf-opt(+0xad4739f)[0x55750af6739f]
./tf-opt(+0xad47662)[0x55750af67662]
./tf-opt(+0xad49c57)[0x55750af69c57]
./tf-opt(+0x850cc53)[0x55750872cc53]
./tf-opt(+0x850cfab)[0x55750872cfab]
./tf-opt(+0x850d1b3)[0x55750872d1b3]
./tf-opt(+0x850ddfd)[0x55750872ddfd]
./tf-opt(+0xbf1504)[0x557500e11504]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f9b591d5bf7]
./tf-opt(+0xd581aa)[0x557500f781aa]
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
./tf-opt(+0xaedf1e3)[0x55750b0ff1e3]
./tf-opt(+0xaedd32d)[0x55750b0fd32d]
./tf-opt(+0xaedd4bc)[0x55750b0fd4bc]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f9b597cf980]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f9b591f2fb7]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f9b591f4921]
/lib/x86_64-linux-gnu/libc.so.6(+0x3048a)[0x7f9b591e448a]
/lib/x86_64-linux-gnu/libc.so.6(+0x30502)[0x7f9b591e4502]
./tf-opt(+0x8287d03)[0x5575084a7d03]
./tf-opt(+0x82a8c02)[0x5575084c8c02]
./tf-opt(+0xa9c3e3a)[0x55750abe3e3a]
./tf-opt(+0xa9c7ac5)[0x55750abe7ac5]
./tf-opt(+0xadec1f9)[0x55750b00c1f9]
./tf-opt(+0xaa859ec)[0x55750aca59ec]
./tf-opt(+0xaa865fd)[0x55750aca65fd]
./tf-opt(+0xaa80a3a)[0x55750aca0a3a]
./tf-opt(+0xad46fa3)[0x55750af66fa3]
./tf-opt(+0xad47662)[0x55750af67662]
./tf-opt(+0xad47fc8)[0x55750af67fc8]
./tf-opt(+0xad464b1)[0x55750af664b1]
./tf-opt(+0xad4739f)[0x55750af6739f]
./tf-opt(+0xad47662)[0x55750af67662]
./tf-opt(+0xad49c57)[0x55750af69c57]
./tf-opt(+0x850cc53)[0x55750872cc53]
./tf-opt(+0x850cfab)[0x55750872cfab]
./tf-opt(+0x850d1b3)[0x55750872d1b3]
./tf-opt(+0x850ddfd)[0x55750872ddfd]
./tf-opt(+0xbf1504)[0x557500e11504]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f9b591d5bf7]
./tf-opt(+0xd581aa)[0x557500f781aa]