This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] Matrix: hide expensive consistency check behind EXPENSIVE_CHECKS macro
ClosedPublic

Authored by arjunp on Feb 10 2023, 4:40 AM.

Details

Summary

This significantly improves performance of Release assert builds.

Diff Detail

Event Timeline

arjunp created this revision.Feb 10 2023, 4:40 AM
arjunp requested review of this revision.Feb 10 2023, 4:40 AM
bondhugula added inline comments.Feb 10 2023, 1:39 PM
mlir/lib/Analysis/Presburger/Matrix.cpp
370

I don't see a single use of this macro in the MLIR codebase or the LLVM C++ sources anywhere. I'm not sure if this is the right one to use. @mehdi_amini, @rriddle - do you have a suggestion?

bondhugula added inline comments.Feb 10 2023, 1:40 PM
mlir/lib/Analysis/Presburger/Matrix.cpp
370

For context, hasConsistentState is only used inside of assert(...) and is meant only for that.

Happy to move it to a different function or just add a function parameter
(off by default) if preferred.

arjunp updated this revision to Diff 496682.Feb 11 2023, 6:20 AM

Use correct macro

arjunp added inline comments.Feb 11 2023, 6:21 AM
mlir/lib/Analysis/Presburger/Matrix.cpp
370

My bad. I picked it up from the CMake, should've checked what the actual macro is. Fixed now.

bondhugula accepted this revision.Feb 13 2023, 2:56 AM

LGTM - thanks

This revision is now accepted and ready to land.Feb 13 2023, 2:56 AM
arjunp retitled this revision from [MLIR][Presburger] Matrix: hide expensive consistency check behind LLVM_ENABLE_EXPENSIVE_CHECKS to [MLIR][Presburger] Matrix: hide expensive consistency check behind EXPENSIVE_CHECKS macro.Feb 13 2023, 10:13 AM
arjunp updated this revision to Diff 497041.Feb 13 2023, 10:22 AM

Rebase to try and fix windows build