From f27016f3debc252a83dfe26af283505ccf009bd0 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 10 Mar 2018 05:15:22 +0000 Subject: [PATCH] [X86] Move the AC_EVEX_2_VEX AsmComments enum to X86InstrInfo.h from X86InstComments.h. X86InstComments.h is used by tools that only have the MC layer. We shouldn't be importing a file from CodeGen into this. X86InstrInfo.h isn't a great place, but I couldn't find a better one. llvm-svn: 327202 --- llvm/lib/Target/X86/InstPrinter/X86InstComments.h | 7 ------- llvm/lib/Target/X86/X86EvexToVex.cpp | 2 +- llvm/lib/Target/X86/X86InstrInfo.h | 6 ++++++ llvm/lib/Target/X86/X86MCInstLower.cpp | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/X86/InstPrinter/X86InstComments.h b/llvm/lib/Target/X86/InstPrinter/X86InstComments.h index b128279..0ba3e74 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86InstComments.h +++ b/llvm/lib/Target/X86/InstPrinter/X86InstComments.h @@ -15,15 +15,8 @@ #ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86INSTCOMMENTS_H #define LLVM_LIB_TARGET_X86_INSTPRINTER_X86INSTCOMMENTS_H -#include "llvm/CodeGen/MachineInstr.h" - namespace llvm { - enum AsmComments { - // For instr that was compressed from EVEX to VEX. - AC_EVEX_2_VEX = MachineInstr::TAsmComments - }; - class MCInst; class MCInstrInfo; class raw_ostream; diff --git a/llvm/lib/Target/X86/X86EvexToVex.cpp b/llvm/lib/Target/X86/X86EvexToVex.cpp index c9d9369..c1d8086 100644 --- a/llvm/lib/Target/X86/X86EvexToVex.cpp +++ b/llvm/lib/Target/X86/X86EvexToVex.cpp @@ -288,7 +288,7 @@ bool EvexToVexInstPass::CompressEvexToVexImpl(MachineInstr &MI) const { return false; MI.setDesc(TII->get(NewOpc)); - MI.setAsmPrinterFlag(AC_EVEX_2_VEX); + MI.setAsmPrinterFlag(X86::AC_EVEX_2_VEX); return true; } diff --git a/llvm/lib/Target/X86/X86InstrInfo.h b/llvm/lib/Target/X86/X86InstrInfo.h index 8bb90eb..2494e38 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.h +++ b/llvm/lib/Target/X86/X86InstrInfo.h @@ -29,6 +29,12 @@ class X86RegisterInfo; class X86Subtarget; namespace X86 { + +enum AsmComments { + // For instr that was compressed from EVEX to VEX. + AC_EVEX_2_VEX = MachineInstr::TAsmComments +}; + // X86 specific condition code. These correspond to X86_*_COND in // X86InstrInfo.td. They must be kept in synch. enum CondCode { diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index f5f87c1..70949ba 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -1454,7 +1454,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) { // Add a comment about EVEX-2-VEX compression for AVX-512 instrs that // are compressed from EVEX encoding to VEX encoding. if (TM.Options.MCOptions.ShowMCEncoding) { - if (MI->getAsmPrinterFlags() & AC_EVEX_2_VEX) + if (MI->getAsmPrinterFlags() & X86::AC_EVEX_2_VEX) OutStreamer->AddComment("EVEX TO VEX Compression ", false); } -- 2.7.4