From e24013abeefc191037ae03e0785a490ba6f09bd6 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 --- tools/llvm-exegesis/lib/X86/Target.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/llvm-exegesis/lib/X86/Target.cpp b/tools/llvm-exegesis/lib/X86/Target.cpp index 270825a8777..827e2e27a2f 100644 --- a/tools/llvm-exegesis/lib/X86/Target.cpp +++ b/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: