Introduce integer division and remainder operations
This adds signed/unsigned integer division and remainder operations to the StandardOps dialect. Two versions are required because MLIR integers are signless, but the meaning of the leading bit is important in division and affects the results. LLVM IR made a similar choice. Define the operations in the tablegen file and add simple constant folding hooks in the C++ implementation. Handle signed division overflow and division by zero errors in constant folding. Canonicalization is left for future work. These operations are necessary to lower affine_apply's down to LLVM IR. PiperOrigin-RevId: 228077549
Loading
Please sign in to comment