This is an archive of the discontinued LLVM Phabricator instance.

[mlir][math] Add math.ctlz expansion to control flow + arith operations
ClosedPublic

Authored by rsuderman on May 23 2022, 5:31 PM.

Details

Summary

Ctlz is an intrinsic in LLVM but does not have equivalent operations in SPIR-V.
Including a decomposition gives an alternative path for these platforms.

Diff Detail

Event Timeline

rsuderman created this revision.May 23 2022, 5:31 PM
rsuderman requested review of this revision.May 23 2022, 5:31 PM
rsuderman updated this revision to Diff 431542.May 23 2022, 5:32 PM

Added missing newline

NatashaKnk added inline comments.May 24 2022, 8:12 AM
mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp
87

Can the input not be negative? The variable is called largerThanZero but the comparison is about equality -- would it be better to use a gt predicates?

rsuderman updated this revision to Diff 432415.May 26 2022, 4:44 PM

Changed var name to be more correct.

rsuderman updated this revision to Diff 432416.May 26 2022, 4:45 PM
rsuderman marked an inline comment as done.

Woops, slight typo

Update for natashaknk@'s comments.

NatashaKnk accepted this revision.May 30 2022, 8:18 AM
This revision is now accepted and ready to land.May 30 2022, 8:18 AM