This is an archive of the discontinued LLVM Phabricator instance.

[mlir][arith] Add shli support to WIE
ClosedPublic

Authored by kuhar on Oct 4 2022, 6:44 PM.

Diff Detail

Event Timeline

kuhar created this revision.Oct 4 2022, 6:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 6:44 PM
kuhar requested review of this revision.Oct 4 2022, 6:44 PM
ThomasRaoux accepted this revision.Oct 5 2022, 11:35 AM
ThomasRaoux added inline comments.
mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
501

are we sure the converted type will be a vector type? This is not consistent with other patterns that use dyn_cast_or_null?

509

nit: do you mean that we assume the shift amount is < oldBitWidth? I'm not understanding this comment.

This revision is now accepted and ready to land.Oct 5 2022, 11:35 AM
kuhar added inline comments.Oct 5 2022, 11:39 AM
mlir/lib/Dialect/Arith/Transforms/EmulateWideInt.cpp
501

Good catch!

509

oldBitWidth == 2 * newBitWidth. Because we mostly care about newBitWidth in the rest of the code and in the comments (e.g., narrower shift by >= newBitWidth are not legal), I think it's better to stay consistent an explain everything in terms of newBitWidth.

kuhar updated this revision to Diff 465499.Oct 5 2022, 12:08 PM

Address review comments. Fix typos in examples. Rebase.

kuhar marked 2 inline comments as done.Oct 5 2022, 12:08 PM
This revision was landed with ongoing or failed builds.Oct 5 2022, 12:21 PM
This revision was automatically updated to reflect the committed changes.