From 6fa6974e8dd0a1ae03771c98a1dfff5c29d56160 Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Wed, 10 Feb 2021 19:44:15 -0800 Subject: [PATCH] [XLA/GPU] Plumb through Bitcast op for LMHLO. Also remove BitcastOp. XLA bitcast requires the input buffer to alias the output buffer, which makes bitcast always a no-op. PiperOrigin-RevId: 356884383 --- include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td | 6 ------ tests/lhlo_ops.mlir | 8 -------- 2 files changed, 14 deletions(-) diff --git a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td index fb1e176..d723aad 100644 --- a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td +++ b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td @@ -380,12 +380,6 @@ def LHLO_BatchNormTrainingOp : LHLO_Op<"batch_norm_training", []>, ); } -// TODO(timshen): add a custom verifier. -def LHLO_BitcastOp: LHLO_Op<"bitcast", []> { - let arguments = (ins Arg:$input, - Arg:$output); -} - def LHLO_BroadcastOp : LHLO_Op<"broadcast", []>, BASE_HLO_BroadcastOp { let arguments = (ins diff --git a/tests/lhlo_ops.mlir b/tests/lhlo_ops.mlir index b01beb7..021ea31 100644 --- a/tests/lhlo_ops.mlir +++ b/tests/lhlo_ops.mlir @@ -899,14 +899,6 @@ func @while_memrefs(%arg0: memref, %arg1: memref<5xf32>, %arg0_out: memref< // ----- -// CHECK-LABEL: func @bitcast_memrefs -func @bitcast_memrefs(%arg0: memref<1xf64>, %arg_out: memref<2xi32>) -> () { - "lmhlo.bitcast"(%arg0, %arg_out) : (memref<1xf64>, memref<2xi32>) -> () - return -} - -// ----- - // CHECK-LABEL: func @scatter_memrefs func @scatter_memrefs(%input: memref<200x100x300xf32>, %indices: memref<10x2xi32>, %updates: memref<10x300xf32>, %arg_out: memref<200x100x300xf32>) -> () {