[PATCH] D53585: [llvm-mca] Improved error handling and error reporting from class InstrBuilder.

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 09:33:36 PDT 2018


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

This patch adds a new class named `InstructionError` to improve the error reporting in the driver.

A new class named `InstructionError` has been added to Support.h in order to improve the error reporting from class InstrBuilder.
The llvm-mca driver is responsible for handling InstructionError objects, and printing them out to stderr.

The goal of this patch is to remove all the remaining error handling logic from the library code.
In particular, this allows us to:

- Simplify the logic in InstrBuilder by removing a needless dependency from MCInstrPrinter.
- Centralize all the error halding logic in a new function named 'runPipeline' (see llvm-mca.cpp).

This is also a first step towards generalizing class InstrBuilder, so that in future, we will be able to reuse its logic to also "lower" MachineInstr to mca::Instruction objects.

Let me know if okay to commit.


https://reviews.llvm.org/D53585

Files:
  test/tools/llvm-mca/ARM/unsupported-write-variant.s
  tools/llvm-mca/include/InstrBuilder.h
  tools/llvm-mca/include/Support.h
  tools/llvm-mca/lib/InstrBuilder.cpp
  tools/llvm-mca/llvm-mca.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53585.170666.patch
Type: text/x-patch
Size: 9477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181023/37526197/attachment.bin>


More information about the llvm-commits mailing list