This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Python] Add checking process before create an AffineMap from a permutation.
ClosedPublic

Authored by zhanghb97 on Jan 12 2021, 5:52 AM.

Details

Summary

An invalid permutation will trigger a C++ assertion when attempting to create an AffineMap from the permutation.
This patch adds an isPermutation function to check the given permutation before creating the AffineMap.

Diff Detail

Event Timeline

zhanghb97 created this revision.Jan 12 2021, 5:52 AM
zhanghb97 requested review of this revision.Jan 12 2021, 5:52 AM
mehdi_amini accepted this revision.Jan 12 2021, 1:28 PM
mehdi_amini added inline comments.
mlir/lib/Bindings/Python/IRModules.cpp
157

Typo: Permutation

This revision is now accepted and ready to land.Jan 12 2021, 1:28 PM
This revision was landed with ongoing or failed builds.Jan 12 2021, 5:32 PM
This revision was automatically updated to reflect the committed changes.
zhanghb97 marked an inline comment as done.Jan 12 2021, 5:34 PM