This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Introduce a simple (error/warning) status framework for mca.
AbandonedPublic

Authored by mattd on Aug 9 2018, 5:22 PM.

Details

Summary

The following framework provides a status notification system for handling
errors/warnings/notes produced within the pieces of llvm-mca that will
eventually become a library.

This patch is just an idea and only implements the fatal error handler. I'm
happy to build on it, if it appears to be the right approach.

The original prototype for the status framework, decorated a subset of llvm-mca
routines with llvm::Error, llvm::Expected. However, I became fearful that
such an approach was adding both overhead and complexity to the code, when all we really
want to do is offload some fatal errors to an error handler.

If this idea appears to be the correct approach, then I am happy to break
this idea into two separate patches. One patch to introduce Status.h and
another to make use of the items in Status.h

In the future we might still want llvm::Error/Expected to handle the
case of recoverable errors, but for fatal errors the solution in this patch seems
to be the least intrusive. And, of course, we'll want some tests for the
other handlers. The unsupported-instruction.s test is testing the fatal handler.

I made mca::Context inherit from StatusManager. I'm not sure that is the right
approach in the long-run, but for prototyping this idea out, it provides a
seamless interface between the mca::Context and the callers to the
status framework.

Diff Detail

Event Timeline

mattd created this revision.Aug 9 2018, 5:22 PM
mattd edited the summary of this revision. (Show Details)Aug 9 2018, 5:23 PM
mattd abandoned this revision.Aug 14 2018, 2:36 PM

Abandoning in favor of https://reviews.llvm.org/D50561