Lowering for mhlo.ceil to std.ceil
PiperOrigin-RevId: 326335301
This commit is contained in:
parent
ec328ae43b
commit
5252aeae8f
|
@ -36,6 +36,10 @@ def IsSameSizePred : CPred<
|
|||
def IsSameSizeConstraint : Constraint<IsSameSizePred, "inputs are same size">;
|
||||
|
||||
|
||||
// Unary Lowering Patterns.
|
||||
def : Pat<(HLO_CeilOp HLO_FpTensor:$i), (CeilFOp $i)>;
|
||||
|
||||
// Binary Lowering Patterns.
|
||||
def : Pat<(HLO_AndOp HLO_PredTensor:$l, HLO_PredTensor:$r),
|
||||
(AndOp $l, $r),
|
||||
[(IsSameSizeConstraint $l, $r)]>;
|
||||
|
|
|
@ -42,6 +42,15 @@ func @binary_ops_int(%arg0: tensor<4xi32>, %arg1: tensor<4xi32>) -> tensor<4xi32
|
|||
return %4 : tensor<4xi32>
|
||||
}
|
||||
|
||||
// CHECK-LABEL: func @unary_ops_float
|
||||
func @unary_ops_float(%arg0: tensor<4xf32>) -> tensor<4xf32> {
|
||||
// CHECK-NEXT: %0 = ceilf %arg0 : tensor<4xf32>
|
||||
%0 = "mhlo.ceil"(%arg0) : (tensor<4xf32>) -> tensor<4xf32>
|
||||
|
||||
// CHECK-NEXT: return %0 : tensor<4xf32>
|
||||
return %0 : tensor<4xf32>
|
||||
}
|
||||
|
||||
// CHECK-LABEL: func @compare_int(%arg0: tensor<4xi32>) -> (tensor<4xi1>, tensor<4xi1>, tensor<4xi1>, tensor<4xi1>, tensor<4xi1>, tensor<4xi1>) {
|
||||
func @compare_int(%arg0: tensor<4xi32>) -> (tensor<4xi1>,tensor<4xi1>,tensor<4xi1>,tensor<4xi1>,tensor<4xi1>,tensor<4xi1>) {
|
||||
// CHECK-NEXT: %0 = cmpi "eq", %arg0, %arg0 : tensor<4xi32>
|
||||
|
|
Loading…
Reference in New Issue