Handles lowering from the tosa CastOp to the equivalent linalg lowering. It
includes support for interchange between bool, int, and floating point.
Details
Details
- Reviewers
antiagainst - Commits
- rG47286fc53015: [mlir][tosa] Add tosa.cast to linalg lowering
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
293 | So tosa::CastOp is an op from all types to all types? That's powerful. I'm a bit puzzled by the if-else structure in the following. In my mind, it should follow the order of: if (src == FpType && dst == FpType) { // Use fp to fp ops } else if (src == FpType) { // Use fp to int ops and handle special case for bool } else if (dst == FpType) { // use int to fp ops and handle special case for bool } else { // Use int to int ops and handle special case for bool } or start with if (src == IntType && dst == IntType) ? |
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
293 | I reworked most of the lowering. This should be a lot cleaner. |
So tosa::CastOp is an op from all types to all types? That's powerful.
I'm a bit puzzled by the if-else structure in the following. In my mind, it should follow the order of:
or start with if (src == IntType && dst == IntType) ?