Add tensor.bitcast op to Tensor dialect
authorTrevor Morris <tmorris@nvidia.com>
Tue, 2 May 2023 18:40:44 +0000 (11:40 -0700)
committerRob Suderman <suderman@google.com>
Tue, 2 May 2023 20:20:13 +0000 (13:20 -0700)
commit486a2ca57a27451177c389b485ecb56f88100649
treee254e9852d2227ff3436727abfaf9fb5f52e5161
parente0577ce367759127893def95ce63910de15de1d5
Add tensor.bitcast op to Tensor dialect

Add tensor.bitcast operator to bitcast between two tensors of compatible shape
and same bit width. This can be use to reinterpret an unsigned integer as a
signed integer or vice versa.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D149608
mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
mlir/test/Dialect/Tensor/canonicalize.mlir