This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Create a std op instead of chain of ops.
ClosedPublic

Authored by hanchung on Mar 6 2020, 12:04 PM.

Details

Summary

1-bit integer is tricky in different dialects sometimes. E.g., there is no
arithmetic instructions on 1-bit integer in SPIR-V, i.e., spv.IMul %0, %1 : i1
is not valid. Instead, spv.LogicalAnd %0, %1 : i1 is valid. Creating the op
directly makes lowering easier because we don't need to match a complicated
pattern like !(!lhs && !rhs). Also, this matches the semantic better.

Also add assertions on inputs.

Diff Detail

Event Timeline

hanchung created this revision.Mar 6 2020, 12:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2020, 12:04 PM

Can you provide a test for this?

The commit message could be made more clear as well

nicolasvasilache accepted this revision.Mar 7 2020, 10:43 AM

Accepting conditioned on addressing @mehdi_amini 's comments.

This revision is now accepted and ready to land.Mar 7 2020, 10:43 AM
hanchung updated this revision to Diff 249191.Mar 9 2020, 12:35 PM

Add tests and update commit message.

hanchung edited the summary of this revision. (Show Details)Mar 9 2020, 12:36 PM
This revision was automatically updated to reflect the committed changes.