tensorflow / mlir

"Multi-Level Intermediate Representation" Compiler Infrastructure
1.74k stars 260 forks source link

Add integer sign- and zero-extension and truncation to standard. #134

Closed ombre5733 closed 5 years ago

ombre5733 commented 5 years ago

Currently sext, zext and trunc operations for integers are missing in the standard dialect. If one wants to combine integers of different bit-widths, one has to use the LLVM operations for extending/truncating and introduce custom casts to convert LLVM integer types to standard types. Exposing sext, zext and trunc directly in the standard dialect allows to perfom integer conversions without this hassle.

Since this is my first addition to MLIR, I'd like some feedback for the implementation, especially:

River707 commented 5 years ago

Can you update for the recent changes to head?