Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 14 | pmbaty | 1 | //===-- llvm/CodeGen/TargetOpcodes.h - Target Indep Opcodes -----*- C++ -*-===// |
| 2 | // |
||
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
||
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
||
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
||
| 6 | // |
||
| 7 | //===----------------------------------------------------------------------===// |
||
| 8 | // |
||
| 9 | // This file defines the target independent instruction opcodes. |
||
| 10 | // |
||
| 11 | //===----------------------------------------------------------------------===// |
||
| 12 | |||
| 13 | #ifndef LLVM_CODEGEN_TARGETOPCODES_H |
||
| 14 | #define LLVM_CODEGEN_TARGETOPCODES_H |
||
| 15 | |||
| 16 | namespace llvm { |
||
| 17 | |||
| 18 | /// Invariant opcodes: All instruction sets have these as their low opcodes. |
||
| 19 | /// |
||
| 20 | namespace TargetOpcode { |
||
| 21 | enum { |
||
| 22 | #define HANDLE_TARGET_OPCODE(OPC) OPC, |
||
| 23 | #define HANDLE_TARGET_OPCODE_MARKER(IDENT, OPC) IDENT = OPC, |
||
| 24 | #include "llvm/Support/TargetOpcodes.def" |
||
| 25 | }; |
||
| 26 | } // end namespace TargetOpcode |
||
| 27 | |||
| 28 | /// Check whether the given Opcode is a generic opcode that is not supposed |
||
| 29 | /// to appear after ISel. |
||
| 30 | inline bool isPreISelGenericOpcode(unsigned Opcode) { |
||
| 31 | return Opcode >= TargetOpcode::PRE_ISEL_GENERIC_OPCODE_START && |
||
| 32 | Opcode <= TargetOpcode::PRE_ISEL_GENERIC_OPCODE_END; |
||
| 33 | } |
||
| 34 | |||
| 35 | /// Check whether the given Opcode is a target-specific opcode. |
||
| 36 | inline bool isTargetSpecificOpcode(unsigned Opcode) { |
||
| 37 | return Opcode > TargetOpcode::PRE_ISEL_GENERIC_OPCODE_END; |
||
| 38 | } |
||
| 39 | |||
| 40 | /// \returns true if \p Opcode is an optimization hint opcode which is not |
||
| 41 | /// supposed to appear after ISel. |
||
| 42 | inline bool isPreISelGenericOptimizationHint(unsigned Opcode) { |
||
| 43 | return Opcode >= TargetOpcode::PRE_ISEL_GENERIC_OPTIMIZATION_HINT_START && |
||
| 44 | Opcode <= TargetOpcode::PRE_ISEL_GENERIC_OPTIMIZATION_HINT_END; |
||
| 45 | } |
||
| 46 | |||
| 47 | } // end namespace llvm |
||
| 48 | |||
| 49 | #endif |