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

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 9 17:22:46 PDT 2018


mattd created this revision.
mattd added reviewers: andreadb, RKSimon, courbet.
Herald added subscribers: gbedwell, tschuett.

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.


https://reviews.llvm.org/D50541

Files:
  test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s
  tools/llvm-mca/Context.cpp
  tools/llvm-mca/Context.h
  tools/llvm-mca/InstrBuilder.cpp
  tools/llvm-mca/InstrBuilder.h
  tools/llvm-mca/RegisterFile.cpp
  tools/llvm-mca/RegisterFile.h
  tools/llvm-mca/Status.h
  tools/llvm-mca/llvm-mca.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50541.160037.patch
Type: text/x-patch
Size: 13106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180810/22a0139e/attachment.bin>


More information about the llvm-commits mailing list