[mlir][tosa] Use math.ctlz intrinsic for tosa.clz
authorRobert Suderman <suderman@google.com>
Mon, 16 May 2022 18:08:49 +0000 (11:08 -0700)
committerRob Suderman <suderman@google.com>
Mon, 16 May 2022 18:31:35 +0000 (11:31 -0700)
commitcb4a5eae1eb3fb8be8c0cf73aa9b1e6f9279eda6
tree37eb5cbec70e7e22c66a4d8f16ad1eba39cf2167
parent52c615553cd9f774c618ff26507606a1469b40f3
[mlir][tosa] Use math.ctlz intrinsic for tosa.clz

We were custom counting per bit for the clz instruction. Math dialect
now has an intrinsic to do this in one instruction. Migrated to this
instruction and fixed a minor bug math-to-llvm for the intrinsic.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D125592
mlir/lib/Conversion/MathToLLVM/MathToLLVM.cpp
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir