From 7e2ffe7a6358820c0f1511f3405d3fa8db4c46f4 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Wed, 28 Oct 2020 09:26:29 +0100 Subject: [PATCH] [llvm-exegesis] Do not silently fail on unknown instruction encoding formats. The addition of TILELOADD instructions with a new encoding format triggered a hard abort instead of proper error reporting due to the use of `llvm_unreachable` for actually reachable code. Properly report an error when the encoding format is unknown. Differential Revision: https://reviews.llvm.org/D90289 --- llvm/tools/llvm-exegesis/lib/X86/Target.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/tools/llvm-exegesis/lib/X86/Target.cpp b/llvm/tools/llvm-exegesis/lib/X86/Target.cpp index 270825a..827e2e2 100644 --- a/llvm/tools/llvm-exegesis/lib/X86/Target.cpp +++ b/llvm/tools/llvm-exegesis/lib/X86/Target.cpp @@ -53,7 +53,7 @@ static cl::opt LbrSamplingPeriod( static const char *isInvalidMemoryInstr(const Instruction &Instr) { switch (Instr.Description.TSFlags & X86II::FormMask) { default: - llvm_unreachable("Unknown FormMask value"); + return "Unknown FormMask value"; // These have no memory access. case X86II::Pseudo: case X86II::RawFrm: -- 2.7.4