From 4bcf369d9b7cc2b8452ce42203a82e752c2de795 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 13 Aug 2018 18:11:48 +0000 Subject: [llvm-mca] Propagate fatal llvm-mca errors from library classes to driver. Summary: This patch introduces error handling to propagate the errors from llvm-mca library classes (or what will become library classes) up to the driver. This patch also introduces an enum to make clearer the intention of the return value for Stage::execute. This supports PR38101. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb Subscribers: llvm-commits, tschuett, gbedwell Differential Revision: https://reviews.llvm.org/D50561 llvm-svn: 339594 --- llvm/tools/llvm-mca/RegisterFile.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'llvm/tools/llvm-mca/RegisterFile.cpp') diff --git a/llvm/tools/llvm-mca/RegisterFile.cpp b/llvm/tools/llvm-mca/RegisterFile.cpp index 44de105b899..ea27a8b9b68 100644 --- a/llvm/tools/llvm-mca/RegisterFile.cpp +++ b/llvm/tools/llvm-mca/RegisterFile.cpp @@ -306,8 +306,14 @@ unsigned RegisterFile::isAvailable(ArrayRef Regs) const { // microarchitectural registers in register file #0 was changed by the // users via flag -reg-file-size. Alternatively, the scheduling model // specified a too small number of registers for this register file. - report_fatal_error( - "Not enough microarchitectural registers in the register file"); + LLVM_DEBUG(dbgs() << "Not enough registers in the register file.\n"); + + // FIXME: Normalize the instruction register count to match the + // NumPhysRegs value. This is a highly unusual case, and is not expected + // to occur. This normalization is hiding an inconsistency in either the + // scheduling model or in the value that the user might have specified + // for NumPhysRegs. + NumRegs = RMT.NumPhysRegs; } if (RMT.NumPhysRegs < (RMT.NumUsedPhysRegs + NumRegs)) -- cgit v1.2.3