This is an archive of the discontinued LLVM Phabricator instance.

[mlir][arith] Support wide integer addition emulation
ClosedPublic

Authored by kuhar on Sep 1 2022, 12:05 PM.

Details

Summary

I tested this implementation for all i16 input pairs, when emulating i16
operations with i8 operations.

Diff Detail

Event Timeline

kuhar created this revision.Sep 1 2022, 12:05 PM
Herald added a project: Restricted Project. · View Herald Transcript
kuhar requested review of this revision.Sep 1 2022, 12:05 PM
Mogball added inline comments.Sep 6 2022, 9:22 AM
mlir/lib/Dialect/Arithmetic/Transforms/EmulateWideInt.cpp
137
204

peelOutermostDim will assert if newTy is null

antiagainst accepted this revision.Sep 6 2022, 11:14 AM
antiagainst added inline comments.
mlir/lib/Dialect/Arithmetic/Transforms/EmulateWideInt.cpp
202

op.getType() is under the hood doing op.getResult().getType() for one result ops.

223

rewriter.getZeroAttr?

This revision is now accepted and ready to land.Sep 6 2022, 11:14 AM
Mogball added inline comments.Sep 7 2022, 8:29 AM
mlir/lib/Dialect/Arithmetic/Transforms/EmulateWideInt.cpp
208
kuhar updated this revision to Diff 458632.Sep 7 2022, 8:35 PM
kuhar marked 4 inline comments as done.

Addressed comments. Rebased and updated the vector insertion/extraction logic to match the new memory layout.

kuhar updated this revision to Diff 458633.Sep 7 2022, 8:36 PM

Removed unnecessary includes.

antiagainst requested changes to this revision.Sep 8 2022, 9:03 AM
antiagainst added inline comments.
mlir/lib/Dialect/Arithmetic/Transforms/EmulateWideInt.cpp
258

Not sure this is true. I can have vector ops operating on operands with unsupported integer bitwidth right? This should go through the same legality check like arith dialect.

This revision now requires changes to proceed.Sep 8 2022, 9:03 AM
Mogball added inline comments.Sep 8 2022, 12:02 PM
mlir/lib/Dialect/Arithmetic/Transforms/EmulateWideInt.cpp
258

+1

kuhar updated this revision to Diff 458955.Sep 8 2022, 9:18 PM

Fixed vector dialect legality check. Rebased.

kuhar updated this revision to Diff 458956.Sep 8 2022, 9:18 PM

Fixed spacing around headers.

kuhar marked 2 inline comments as done.Sep 8 2022, 9:18 PM
kuhar updated this revision to Diff 458957.Sep 8 2022, 9:21 PM

Add header for helper functions

Mogball accepted this revision.Sep 9 2022, 10:49 AM

LGTM

antiagainst accepted this revision.Sep 9 2022, 12:00 PM
This revision is now accepted and ready to land.Sep 9 2022, 12:00 PM
This revision was automatically updated to reflect the committed changes.