llvm-project/llvm/lib/Target/Hexagon
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 [MCDisassembler] Disambiguate Size parameter in tryAddingSymbolicOperand() 2022-05-25 13:44:32 -07: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
BitTracker.cpp [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 08:32:54 -07:00
BitTracker.h
CMakeLists.txt
Hexagon.h
Hexagon.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonAsmPrinter.cpp [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
HexagonAsmPrinter.h Reapply [xray] add support for hexagon 2021-12-10 05:32:28 -08:00
HexagonBitSimplify.cpp [Hexagon] Establish size limit for RegisterSet in hexbit 2022-04-20 14:16:24 -07:00
HexagonBitTracker.cpp [Hexagon] Reconize M2_mnaci in HexagonBitTracker 2022-01-07 14:48:29 -08:00
HexagonBitTracker.h
HexagonBlockRanges.cpp
HexagonBlockRanges.h
HexagonBranchRelaxation.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
HexagonCFGOptimizer.cpp [Target] Use range-based for loops (NFC) 2021-12-26 23:49:38 -08:00
HexagonCallingConv.td [Hexagon] Calling conventions for floating point vectors 2021-12-29 09:01:07 -08:00
HexagonCommonGEP.cpp Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 01:07:51 -07:00
HexagonConstExtenders.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
HexagonConstPropagation.cpp [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf 2022-05-19 11:23:13 +01:00
HexagonCopyToCombine.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
HexagonDepArch.h [Hexagon] Move single-use global tables into their only user and turn them into StringSwitch 2022-03-06 19:23:09 +01:00
HexagonDepArch.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonDepDecoders.inc [Disassember][NFCI] Use strong type for instruction decoder 2022-03-25 18:53:59 -07:00
HexagonDepIICHVX.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonDepIICScalar.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonDepITypes.h
HexagonDepITypes.td
HexagonDepInstrFormats.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonDepInstrInfo.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonDepMapAsm2Intrin.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonDepMappings.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonDepMask.h
HexagonDepOperands.td
HexagonDepTimingClasses.h
HexagonEarlyIfConv.cpp [NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments 2022-03-16 20:25:42 +08:00
HexagonExpandCondsets.cpp [NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments 2022-03-16 20:25:42 +08:00
HexagonFixupHwLoops.cpp
HexagonFrameLowering.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
HexagonFrameLowering.h Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
HexagonGenExtract.cpp
HexagonGenInsert.cpp Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 01:07:51 -07:00
HexagonGenMux.cpp [NFC][llvm][Hexagon] Inclusive Terms remove uses of sanity in Hexagon taget 2021-11-22 10:08:01 -05:00
HexagonGenPredicate.cpp [Hexagon] Use range-based for loops (NFC) 2021-12-31 15:17:25 -08:00
HexagonHardwareLoops.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
HexagonHazardRecognizer.cpp [llvm] Use contains (NFC) 2022-06-11 11:46:16 -07:00
HexagonHazardRecognizer.h [Hexagon] HVX .new store uses different resources 2022-01-04 13:35:34 -08:00
HexagonIICHVX.td
HexagonIICScalar.td
HexagonISelDAGToDAG.cpp [Alignment][NFC] Remove usage of MemSDNode::getAlignment 2022-06-07 13:52:20 +00:00
HexagonISelDAGToDAG.h
HexagonISelDAGToDAGHVX.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
HexagonISelLowering.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
HexagonISelLowering.h AtomicExpand: Change return type for shouldExpandAtomicStoreInIR 2022-04-06 22:34:04 -04:00
HexagonISelLoweringHVX.cpp [NFC][CodeGen] Add a setTargetDAGCombine use ArrayRef 2022-03-29 09:53:24 +08:00
HexagonInstrFormats.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonInstrFormatsV60.td
HexagonInstrFormatsV65.td
HexagonInstrInfo.cpp [Target, CodeGen] Use isImm(), isReg(), etc (NFC) 2022-06-18 07:41:04 -07:00
HexagonInstrInfo.h [Hexagon] Fix MachineSink not to hoist FP instructions that update USR. 2022-01-04 15:55:22 -08:00
HexagonIntrinsics.td
HexagonIntrinsicsV5.td
HexagonIntrinsicsV60.td
HexagonLoopIdiomRecognition.cpp [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 10:17:22 -07:00
HexagonLoopIdiomRecognition.h
HexagonMCInstLower.cpp Reapply [xray] add support for hexagon 2021-12-10 05:32:28 -08:00
HexagonMachineFunctionInfo.cpp llvm-reduce: Add cloning of target MachineFunctionInfo 2022-06-07 10:14:48 -04:00
HexagonMachineFunctionInfo.h llvm-reduce: Add cloning of target MachineFunctionInfo 2022-06-07 10:14:48 -04:00
HexagonMachineScheduler.cpp [llvm][Hexagon] Generalize VLIWResourceModel, VLIWMachineScheduler, and ConvergingVLIWScheduler 2021-12-06 16:23:48 -06:00
HexagonMachineScheduler.h [llvm][Hexagon] Generalize VLIWResourceModel, VLIWMachineScheduler, and ConvergingVLIWScheduler 2021-12-06 16:23:48 -06:00
HexagonMapAsm2IntrinV62.gen.td
HexagonNewValueJump.cpp Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 00:31:44 -07:00
HexagonOperands.td
HexagonOptAddrMode.cpp [Hexagon] Punt on registers without reaching defs in addr mode opt 2022-02-01 09:52:59 -08:00
HexagonOptimizeSZextends.cpp [llvm] Use make_early_inc_range (NFC) 2021-11-10 19:56:35 -08:00
HexagonPatterns.td [Hexagon] Create an intrinsic to profile using a custom handler 2022-03-28 10:31:41 -05:00
HexagonPatternsHVX.td [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
HexagonPatternsV65.td [Hexagon] Fix optimize address mode pass only handle BaseImmOffset mode 2022-01-14 15:45:23 -08:00
HexagonPeephole.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
HexagonPseudo.td [Hexagon] Create an intrinsic to profile using a custom handler 2022-03-28 10:31:41 -05:00
HexagonRDFOpt.cpp [NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments 2022-03-16 20:25:42 +08:00
HexagonRegisterInfo.cpp [NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments 2022-03-16 20:25:42 +08:00
HexagonRegisterInfo.h
HexagonRegisterInfo.td [Hexagon] Support BUILD_VECTOR of floating point HVX vectors 2021-12-28 14:59:08 -08:00
HexagonSchedule.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonScheduleV5.td
HexagonScheduleV55.td
HexagonScheduleV60.td
HexagonScheduleV62.td
HexagonScheduleV65.td
HexagonScheduleV66.td
HexagonScheduleV67.td
HexagonScheduleV67T.td
HexagonScheduleV68.td
HexagonScheduleV69.td [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
HexagonSelectionDAGInfo.cpp
HexagonSelectionDAGInfo.h
HexagonSplitConst32AndConst64.cpp [Hexagon] Use make_early_inc_range (NFC) 2021-11-04 08:51:05 -07:00
HexagonSplitDouble.cpp [NFC] Use Register instead of unsigned 2022-01-19 20:17:04 +08:00
HexagonStoreWidening.cpp [llvm] Use range-based for loops (NFC) 2021-11-23 08:54:48 -08:00
HexagonSubtarget.cpp [Hexagon][bolt] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 22:04:57 -07:00
HexagonSubtarget.h [Hexagon] Move single-use global tables into their only user and turn them into StringSwitch 2022-03-06 19:23:09 +01:00
HexagonTargetMachine.cpp [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07:00
HexagonTargetMachine.h mark getTargetTransformInfo and getTargetIRAnalysis as const 2022-02-25 14:30:44 -05:00
HexagonTargetObjectFile.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
HexagonTargetObjectFile.h
HexagonTargetStreamer.h [MC] Add MCSubtargetInfo to MCAlignFragment 2021-09-07 15:46:19 +01:00
HexagonTargetTransformInfo.cpp Recommit "[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`" 2022-04-26 14:02:40 -07:00
HexagonTargetTransformInfo.h Revert "Revert "[AArch64] Set maximum VF with shouldMaximizeVectorBandwidth"" 2022-05-23 16:15:45 +01:00
HexagonVExtract.cpp [NFC][Alignment] Remove max functions between Align and MaybeAlign 2022-06-20 08:37:48 +00:00
HexagonVLIWPacketizer.cpp Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 00:31:44 -07:00
HexagonVLIWPacketizer.h [Hexagon] Fix some issues with packetizing slot0-only instructions 2022-01-04 14:35:37 -08:00
HexagonVectorCombine.cpp [NFC] format InstructionSimplify & lowerCaseFunctionNames 2022-06-09 16:10:08 +02:00
HexagonVectorLoopCarriedReuse.cpp Remove unneeded cl::ZeroOrMore for cl::opt options 2022-06-04 00:10:42 -07:00
HexagonVectorLoopCarriedReuse.h [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
HexagonVectorPrint.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
RDFCopy.cpp
RDFCopy.h
RDFDeadCode.cpp
RDFDeadCode.h