This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add the sqrt operation to mlir.
ClosedPublic

Authored by llitchev on Jan 28 2020, 12:07 PM.

Details

Summary

Add and pipe through the sqrt operation for Standard and LLVM dialects.

Diff Detail

Event Timeline

llitchev created this revision.Jan 28 2020, 12:07 PM
flaub retitled this revision from Add the sqrt operation to mlir. to [MLIR] Add the sqrt operation to mlir..Jan 28 2020, 12:14 PM
flaub added a subscriber: flaub.

Unit tests: pass. 62248 tests passed, 0 failed and 816 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

ftynse requested changes to this revision.Jan 28 2020, 2:39 PM
ftynse added a subscriber: ftynse.
ftynse added inline comments.
mlir/docs/Dialects/Standard.md
606

f8 isn't a valid type :)

609

This description should go into ODS. We have an open bug to fully autogenerate this doc from there.

This revision now requires changes to proceed.Jan 28 2020, 2:39 PM
llitchev updated this revision to Diff 241200.Jan 29 2020, 9:35 AM

Addressed some CR comments re: comments - fixed a type to match an existing type and moved an operation description to a OSD file.

llitchev marked 3 inline comments as done.Jan 29 2020, 9:37 AM
llitchev added inline comments.
mlir/docs/Dialects/Standard.md
606

Changed the type to f32.

609

Moved the description to the op def.

llitchev marked an inline comment as done.Jan 29 2020, 9:37 AM

Unit tests: pass. 62248 tests passed, 0 failed and 816 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

One more nit, thanks!

mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
445

Can we rather take an f64 argument to this function than add another op (constant) irrelevant to the test?

Orthogonally, we should not pattern-match SSA value names (%21). I see that the rest of this file does and that should be fixed independently (patches in that direction appreciated), but let's not introduce any new such matches. See https://mlir.llvm.org/getting_started/TestingGuide/ for more details.

llitchev updated this revision to Diff 241281.Jan 29 2020, 1:46 PM

Addressed CR re: test matching rules and use of a temp f64 const.

llitchev updated this revision to Diff 241285.Jan 29 2020, 1:51 PM
llitchev marked 2 inline comments as done.

Clean up one more ordinal used for f32 sqrt test.

mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
445

Yeah, my thought was to stick with the general file style - the tanh test above uses const and yes, the file uses the ordinal names for the vars...

Unit tests: fail. 62247 tests passed, 1 failed and 816 were skipped.

failed: libc++.std/thread/thread_mutex/thread_mutex_requirements/thread_timedmutex_requirements/thread_timedmutex_recursive/try_lock_for.pass.cpp

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Unit tests: pass. 62248 tests passed, 0 failed and 816 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

ftynse accepted this revision.Jan 29 2020, 2:29 PM
ftynse added inline comments.
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
445

I must have missed that when reviewing that commit. Thanks!

This revision is now accepted and ready to land.Jan 29 2020, 2:29 PM
llitchev updated this revision to Diff 241345.Jan 29 2020, 9:11 PM

Resolved a merge conflict in LLVMOps.td due to changes coming from master.

Unit tests: pass. 62318 tests passed, 0 failed and 838 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Please LMK if you need somebody to commit this for you

frej added a subscriber: frej.Jan 30 2020, 2:56 AM
flaub added a comment.Jan 30 2020, 7:41 AM

Thanks @ftynse, I'll land this shortly.

This revision was automatically updated to reflect the committed changes.