From 7d522b6eee0cac4427ee36f770284ec23ed690b5 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 3 Apr 2018 06:37:01 +0000 Subject: [PATCH] [X86][TableGen] Add a missing error check to make sure EVEX instructions use one PS/PD/XS/XD prefixes. llvm-svn: 329048 --- llvm/utils/TableGen/X86RecognizableInstr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/utils/TableGen/X86RecognizableInstr.cpp b/llvm/utils/TableGen/X86RecognizableInstr.cpp index a387efb7ebcf..5811528f1864 100644 --- a/llvm/utils/TableGen/X86RecognizableInstr.cpp +++ b/llvm/utils/TableGen/X86RecognizableInstr.cpp @@ -243,8 +243,12 @@ InstructionContext RecognizableInstr::insnContext() const { insnContext = EVEX_KB(IC_EVEX_XD); else if (OpPrefix == X86Local::XS) insnContext = EVEX_KB(IC_EVEX_XS); - else + else if (OpPrefix == X86Local::PS) insnContext = EVEX_KB(IC_EVEX); + else { + errs() << "Instruction does not use a prefix: " << Name << "\n"; + llvm_unreachable("Invalid prefix"); + } /// eof EVEX } else if (Encoding == X86Local::VEX || Encoding == X86Local::XOP) { if (HasVEX_LPrefix && VEX_WPrefix == X86Local::VEX_W1) {