[llvm] 7e2ffe7 - [llvm-exegesis] Do not silently fail on unknown instruction encoding formats.
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 28 02:07:10 PDT 2020
Author: Clement Courbet
Date: 2020-10-28T10:06:00+01:00
New Revision: 7e2ffe7a6358820c0f1511f3405d3fa8db4c46f4
URL: https://github.com/llvm/llvm-project/commit/7e2ffe7a6358820c0f1511f3405d3fa8db4c46f4
DIFF: https://github.com/llvm/llvm-project/commit/7e2ffe7a6358820c0f1511f3405d3fa8db4c46f4.diff
LOG: [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
Added:
Modified:
llvm/tools/llvm-exegesis/lib/X86/Target.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-exegesis/lib/X86/Target.cpp b/llvm/tools/llvm-exegesis/lib/X86/Target.cpp
index 270825a8777b..827e2e27a2f8 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<unsigned> 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:
More information about the llvm-commits
mailing list