llvm-project/llvm/lib/Target/Mips
David Green 3e0bf1c7a9 [CodeGen] Move instruction predicate verification to emitInstruction
D25618 added a method to verify the instruction predicates for an
emitted instruction, through verifyInstructionPredicates added into
<Target>MCCodeEmitter::encodeInstruction. This is a very useful idea,
but the implementation inside MCCodeEmitter made it only fire for object
files, not assembly which most of the llvm test suite uses.

This patch moves the code into the <Target>_MC::verifyInstructionPredicates
method, inside the InstrInfo.  The allows it to be called from other
places, such as in this patch where it is called from the
<Target>AsmPrinter::emitInstruction methods which should trigger for
both assembly and object files. It can also be called from other places
such as verifyInstruction, but that is not done here (it tends to catch
errors earlier, but in reality just shows all the mir tests that have
incorrect feature predicates). The interface was also simplified
slightly, moving computeAvailableFeatures into the function so that it
does not need to be called externally.

The ARM, AMDGPU (but not R600), AVR, Mips and X86 backends all currently
show errors in the test-suite, so have been disabled with FIXME
comments.

Recommitted with some fixes for the leftover MCII variables in release
builds.

Differential Revision: https://reviews.llvm.org/D129506
2022-07-14 09:33:28 +01:00
..
AsmParser [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
Disassembler Rename `MCFixedLenDisassembler.h` as `MCDecoderOps.h` 2022-05-15 08:44:58 +08:00
MCTargetDesc [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
TargetInfo Fix shlib builds for all lib/Target/*/TargetInfo libs 2021-10-08 15:21:13 -07:00
CMakeLists.txt [Mips] Implement hasDivRemOp() 2022-05-16 14:45:40 +08:00
MSA.txt
MicroMips32r6InstrFormats.td [MIPS] Remove unused tblgen template args. NFC 2021-09-15 12:16:07 +03:00
MicroMips32r6InstrInfo.td [llvm-objdump] Implemented PrintBranchImmAsAddress for MIPS 2022-04-15 23:48:38 +02:00
MicroMipsDSPInstrFormats.td
MicroMipsDSPInstrInfo.td [MIPS] Remove unused tblgen template args. NFC 2021-09-15 12:16:07 +03:00
MicroMipsInstrFPU.td [MIPS} Address ISel failures for 64 bit fpus in microMIPS 2022-05-12 23:25:09 +01:00
MicroMipsInstrFormats.td
MicroMipsInstrInfo.td [MIPS] Remove an incorrect microMIPS instruction alias 2022-05-11 23:40:38 +01:00
MicroMipsSizeReduction.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
Mips.h Mips/GlobalISel: Add stub post-legalizer combiner 2022-04-14 22:04:59 -04:00
Mips.td [llvm-objdump] Implemented PrintBranchImmAsAddress for MIPS 2022-04-15 23:48:38 +02:00
Mips16FrameLowering.cpp [NFC] Use Register instead of unsigned 2022-01-19 20:17:04 +08:00
Mips16FrameLowering.h
Mips16HardFloat.cpp [Mips16HardFloat] Simplify attribute change (NFC) 2021-12-22 09:41:11 +01:00
Mips16HardFloatInfo.cpp
Mips16HardFloatInfo.h
Mips16ISelDAGToDAG.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
Mips16ISelDAGToDAG.h
Mips16ISelLowering.cpp Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
Mips16ISelLowering.h
Mips16InstrFormats.td
Mips16InstrInfo.cpp [NFC] Use Register instead of unsigned 2022-01-19 20:17:04 +08:00
Mips16InstrInfo.h
Mips16InstrInfo.td [MIPS] Remove unused tblgen template args. NFC 2021-09-15 12:16:07 +03:00
Mips16RegisterInfo.cpp [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
Mips16RegisterInfo.h
Mips32r6InstrFormats.td
Mips32r6InstrInfo.td [llvm-objdump] Implemented PrintBranchImmAsAddress for MIPS 2022-04-15 23:48:38 +02:00
Mips64InstrInfo.td
Mips64r6InstrInfo.td
MipsAnalyzeImmediate.cpp [Target] Use range-based for loops (NFC) 2022-01-01 10:14:05 -08:00
MipsAnalyzeImmediate.h
MipsAsmPrinter.cpp [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
MipsAsmPrinter.h
MipsBranchExpansion.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsCCState.cpp Mips/GlobalISel: Use more standard call lowering infrastructure 2021-07-13 11:04:10 -04:00
MipsCCState.h Mips/GlobalISel: Use more standard call lowering infrastructure 2021-07-13 11:04:10 -04:00
MipsCallLowering.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsCallLowering.h [Target] Remove unused forward declarations (NFC) 2022-01-02 10:20:15 -08:00
MipsCallingConv.td
MipsCombine.td Mips/GlobalISel: Add stub post-legalizer combiner 2022-04-14 22:04:59 -04:00
MipsCondMov.td
MipsConstantIslandPass.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsDSPInstrFormats.td
MipsDSPInstrInfo.td [MIPS] Remove unused tblgen template args. NFC 2021-09-15 12:16:07 +03:00
MipsDelaySlotFiller.cpp [MIPS] Remove an incorrect microMIPS instruction alias 2022-05-11 23:40:38 +01:00
MipsEVAInstrFormats.td
MipsEVAInstrInfo.td [MIPS] Remove unused tblgen template args. NFC 2021-09-15 12:16:07 +03:00
MipsExpandPseudo.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsFastISel.cpp [NFC] Remove dead code in MipsFastISel 2022-06-13 13:36:36 +00:00
MipsFrameLowering.cpp
MipsFrameLowering.h PrologEpilogInserter: Use explicit control for scavenge slot placement 2021-11-23 18:01:12 -05:00
MipsISelDAGToDAG.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsISelDAGToDAG.h
MipsISelLowering.cpp [Alignment][NFC] Remove usage of MemSDNode::getAlignment 2022-06-07 13:52:20 +00:00
MipsISelLowering.h [MIPS] Address instruction selection failure for abs.[sd] 2022-04-29 23:10:58 +01:00
MipsInstrFPU.td
MipsInstrFormats.td
MipsInstrInfo.cpp [MIPS] Remove an incorrect microMIPS instruction alias 2022-05-11 23:40:38 +01:00
MipsInstrInfo.h [MIPS] Remove an incorrect microMIPS instruction alias 2022-05-11 23:40:38 +01:00
MipsInstrInfo.td [llvm-objdump] Implemented PrintBranchImmAsAddress for MIPS 2022-04-15 23:48:38 +02:00
MipsInstructionSelector.cpp [Target] Remove redundant member initialization (NFC) 2022-01-06 22:01:44 -08:00
MipsLegalizerInfo.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsLegalizerInfo.h
MipsMCInstLower.cpp [Target] Use range-based for loops (NFC) 2021-11-27 11:16:19 -08:00
MipsMCInstLower.h
MipsMSAInstrFormats.td
MipsMSAInstrInfo.td [MIPS] Remove unused tblgen template args. NFC 2021-09-15 12:16:07 +03:00
MipsMTInstrFormats.td
MipsMTInstrInfo.td
MipsMachineFunction.cpp llvm-reduce: Add cloning of target MachineFunctionInfo 2022-06-07 10:14:48 -04:00
MipsMachineFunction.h llvm-reduce: Add cloning of target MachineFunctionInfo 2022-06-07 10:14:48 -04:00
MipsModuleISelDAGToDAG.cpp Cleanup codegen includes 2022-03-16 08:43:00 +01:00
MipsMulMulBugPass.cpp [mips] Improve vr4300 mulmul bugfix pass 2022-01-20 20:10:04 +03:00
MipsOptimizePICCall.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsOptionRecord.h
MipsOs16.cpp Cleanup includes: LLVMTarget 2022-03-10 10:00:29 +01:00
MipsPfmCounters.td
MipsPostLegalizerCombiner.cpp Mips/GlobalISel: Add stub post-legalizer combiner 2022-04-14 22:04:59 -04:00
MipsPreLegalizerCombiner.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsRegisterBankInfo.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsRegisterBankInfo.h [nfc][codegen] Move RegisterBank[Info].h under CodeGen 2022-03-01 21:53:25 -08:00
MipsRegisterBanks.td
MipsRegisterInfo.cpp [Target] use range-based for loops (NFC) 2022-01-07 21:20:36 -08:00
MipsRegisterInfo.h
MipsRegisterInfo.td
MipsSEFrameLowering.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsSEFrameLowering.h
MipsSEISelDAGToDAG.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
MipsSEISelDAGToDAG.h
MipsSEISelLowering.cpp [Alignment][NFC] Remove usage of MemSDNode::getAlignment 2022-06-07 13:52:20 +00:00
MipsSEISelLowering.h
MipsSEInstrInfo.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
MipsSEInstrInfo.h
MipsSERegisterInfo.cpp [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
MipsSERegisterInfo.h
MipsSchedule.td
MipsScheduleGeneric.td [MIPS} Address ISel failures for 64 bit fpus in microMIPS 2022-05-12 23:25:09 +01:00
MipsScheduleP5600.td
MipsSubtarget.cpp [Support] Make report_fatal_error respect its GenCrashDiag argument so it doesn't generate a backtrace 2022-05-30 19:19:23 +01:00
MipsSubtarget.h [MIPS] Initial support for MIPS-I load delay slots 2022-04-07 01:02:29 +01:00
MipsTargetMachine.cpp [llvm] Don't use Optional::hasValue (NFC) 2022-06-20 10:38:12 -07:00
MipsTargetMachine.h mark getTargetTransformInfo and getTargetIRAnalysis as const 2022-02-25 14:30:44 -05:00
MipsTargetObjectFile.cpp
MipsTargetObjectFile.h
MipsTargetStreamer.h Don't use Optional::hasValue (NFC) 2022-06-20 11:33:56 -07:00
MipsTargetTransformInfo.cpp [Mips] Implement hasDivRemOp() 2022-05-16 14:45:40 +08:00
MipsTargetTransformInfo.h [Mips] Implement hasDivRemOp() 2022-05-16 14:45:40 +08:00
Relocation.txt