LLVM 18.0.0git
PPC.h
Go to the documentation of this file.
1//===-- PPC.h - Top-level interface for PowerPC Target ----------*- 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 contains the entry points for global functions defined in the LLVM
10// PowerPC back-end.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_POWERPC_PPC_H
15#define LLVM_LIB_TARGET_POWERPC_PPC_H
16
18
19// GCC #defines PPC on Linux but we use it as our namespace name
20#undef PPC
21
22namespace llvm {
23class PPCRegisterBankInfo;
24class PPCSubtarget;
25class PPCTargetMachine;
26class PassRegistry;
27class FunctionPass;
28class InstructionSelector;
29class MachineInstr;
30class MachineOperand;
31class AsmPrinter;
32class MCInst;
33class MCOperand;
34class ModulePass;
35
36#ifndef NDEBUG
37 FunctionPass *createPPCCTRLoopsVerify();
38#endif
39 FunctionPass *createPPCLoopInstrFormPrepPass(PPCTargetMachine &TM);
58 AsmPrinter &AP);
60 MCOperand &OutMO, AsmPrinter &AP);
61
62#ifndef NDEBUG
64#endif
83
84 extern char &PPCVSXFMAMutateID;
85
88 extern char &PPCLowerMASSVEntriesID;
89
92 extern char &PPCGenScalarMASSEntriesID;
93
96 const PPCRegisterBankInfo &);
97 namespace PPCII {
98
99 /// Target Operand Flag enum.
100 enum TOF {
101 //===------------------------------------------------------------------===//
102 // PPC Specific MachineOperand flags.
104
105 /// On a symbol operand "FOO", this indicates that the reference is actually
106 /// to "FOO@plt". This is used for calls and jumps to external functions
107 /// and for PIC calls on 32-bit ELF systems.
109
110 /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
111 /// the function's picbase, e.g. lo16(symbol-picbase).
113
114 /// MO_PCREL_FLAG - If this bit is set, the symbol reference is relative to
115 /// the current instruction address(pc), e.g., var@pcrel. Fixup is VK_PCREL.
117
118 /// MO_GOT_FLAG - If this bit is set the symbol reference is to be computed
119 /// via the GOT. For example when combined with the MO_PCREL_FLAG it should
120 /// produce the relocation @got@pcrel. Fixup is VK_PPC_GOT_PCREL.
122
123 // MO_PCREL_OPT_FLAG - If this bit is set the operand is part of a
124 // PC Relative linker optimization.
126
127 /// MO_TLSGD_FLAG - If this bit is set the symbol reference is relative to
128 /// TLS General Dynamic model for Linux and the variable offset of TLS
129 /// General Dynamic model for AIX.
131
132 /// MO_TPREL_FLAG - If this bit is set, the symbol reference is relative to
133 /// the thread pointer and the symbol can be used for the TLS Initial Exec
134 /// and Local Exec models.
136
137 /// MO_TLSLD_FLAG - If this bit is set the symbol reference is relative to
138 /// TLS Local Dynamic model.
140
141 /// MO_TLSGDM_FLAG - If this bit is set the symbol reference is relative
142 /// to the region handle of TLS General Dynamic model for AIX.
144
145 /// MO_GOT_TLSGD_PCREL_FLAG - A combintaion of flags, if these bits are set
146 /// they should produce the relocation @got@tlsgd@pcrel.
147 /// Fix up is VK_PPC_GOT_TLSGD_PCREL
149
150 /// MO_GOT_TLSLD_PCREL_FLAG - A combintaion of flags, if these bits are set
151 /// they should produce the relocation @got@tlsld@pcrel.
152 /// Fix up is VK_PPC_GOT_TLSLD_PCREL
154
155 /// MO_GOT_TPREL_PCREL_FLAG - A combintaion of flags, if these bits are set
156 /// they should produce the relocation @got@tprel@pcrel.
157 /// Fix up is VK_PPC_GOT_TPREL_PCREL
159
160 /// The next are not flags but distinct values.
162
163 /// MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
164 MO_LO = 1 << 8,
165 MO_HA = 2 << 8,
166
167 MO_TPREL_LO = 4 << 8,
168 MO_TPREL_HA = 3 << 8,
169
170 /// These values identify relocations on immediates folded
171 /// into memory operations.
172 MO_DTPREL_LO = 5 << 8,
173 MO_TLSLD_LO = 6 << 8,
174 MO_TOC_LO = 7 << 8,
175
176 // Symbol for VK_PPC_TLS fixup attached to an ADD instruction
177 MO_TLS = 8 << 8
178 };
179 } // end namespace PPCII
180
181} // end namespace llvm;
182
183#endif
IRTranslator LLVM IR MI
const char LLVMTargetMachineRef TM
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:85
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:311
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
Instances of this class represent operands of the MCInst class.
Definition: MCInst.h:36
Representation of each machine instruction.
Definition: MachineInstr.h:68
MachineOperand class - Representation of each machine instruction operand.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:251
Common code between 32-bit and 64-bit PowerPC targets.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:37
TOF
Target Operand Flag enum.
Definition: PPC.h:100
@ MO_TLSLD_LO
Definition: PPC.h:173
@ MO_GOT_TPREL_PCREL_FLAG
MO_GOT_TPREL_PCREL_FLAG - A combintaion of flags, if these bits are set they should produce the reloc...
Definition: PPC.h:158
@ MO_ACCESS_MASK
The next are not flags but distinct values.
Definition: PPC.h:161
@ MO_TLSGDM_FLAG
MO_TLSGDM_FLAG - If this bit is set the symbol reference is relative to the region handle of TLS Gene...
Definition: PPC.h:143
@ MO_PCREL_FLAG
MO_PCREL_FLAG - If this bit is set, the symbol reference is relative to the current instruction addre...
Definition: PPC.h:116
@ MO_TLSLD_FLAG
MO_TLSLD_FLAG - If this bit is set the symbol reference is relative to TLS Local Dynamic model.
Definition: PPC.h:139
@ MO_GOT_FLAG
MO_GOT_FLAG - If this bit is set the symbol reference is to be computed via the GOT.
Definition: PPC.h:121
@ MO_NO_FLAG
Definition: PPC.h:103
@ MO_TPREL_HA
Definition: PPC.h:168
@ MO_PLT
On a symbol operand "FOO", this indicates that the reference is actually to "FOO@plt".
Definition: PPC.h:108
@ MO_DTPREL_LO
These values identify relocations on immediates folded into memory operations.
Definition: PPC.h:172
@ MO_TLS
Definition: PPC.h:177
@ MO_TPREL_FLAG
MO_TPREL_FLAG - If this bit is set, the symbol reference is relative to the thread pointer and the sy...
Definition: PPC.h:135
@ MO_TPREL_LO
Definition: PPC.h:167
@ MO_LO
MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
Definition: PPC.h:164
@ MO_GOT_TLSLD_PCREL_FLAG
MO_GOT_TLSLD_PCREL_FLAG - A combintaion of flags, if these bits are set they should produce the reloc...
Definition: PPC.h:153
@ MO_TOC_LO
Definition: PPC.h:174
@ MO_TLSGD_FLAG
MO_TLSGD_FLAG - If this bit is set the symbol reference is relative to TLS General Dynamic model for ...
Definition: PPC.h:130
@ MO_GOT_TLSGD_PCREL_FLAG
MO_GOT_TLSGD_PCREL_FLAG - A combintaion of flags, if these bits are set they should produce the reloc...
Definition: PPC.h:148
@ MO_HA
Definition: PPC.h:165
@ MO_PIC_FLAG
MO_PIC_FLAG - If this bit is set, the symbol reference is relative to the function's picbase,...
Definition: PPC.h:112
@ MO_PCREL_OPT_FLAG
Definition: PPC.h:125
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
ModulePass * createPPCMergeStringPoolPass()
FunctionPass * createPPCPreEmitPeepholePass()
void initializePPCTLSDynamicCallPass(PassRegistry &)
FunctionPass * createPPCLoopInstrFormPrepPass(PPCTargetMachine &TM)
FunctionPass * createPPCVSXFMAMutatePass()
void initializePPCVSXFMAMutatePass(PassRegistry &)
bool LowerPPCMachineOperandToMCOperand(const MachineOperand &MO, MCOperand &OutMO, AsmPrinter &AP)
void initializePPCLowerMASSVEntriesPass(PassRegistry &)
FunctionPass * createPPCCTRLoopsPass()
Definition: PPCCTRLoops.cpp:93
FunctionPass * createPPCTLSDynamicCallPass()
void initializePPCMergeStringPoolPass(PassRegistry &)
FunctionPass * createPPCEarlyReturnPass()
void initializePPCPreEmitPeepholePass(PassRegistry &)
FunctionPass * createPPCExpandAtomicPseudoPass()
void initializePPCTOCRegDepsPass(PassRegistry &)
void initializePPCReduceCRLogicalsPass(PassRegistry &)
void initializePPCDAGToDAGISelPass(PassRegistry &)
void initializePPCVSXCopyPass(PassRegistry &)
FunctionPass * createPPCVSXCopyPass()
void initializePPCCTRLoopsVerifyPass(PassRegistry &)
FunctionPass * createPPCVSXSwapRemovalPass()
void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, AsmPrinter &AP)
void initializePPCCTRLoopsPass(PassRegistry &)
ModulePass * createPPCLowerMASSVEntriesPass()
ModulePass * createPPCGenScalarMASSEntriesPass()
void initializePPCEarlyReturnPass(PassRegistry &)
CodeGenOptLevel
Code generation optimization level.
Definition: CodeGen.h:54
void initializePPCGenScalarMASSEntriesPass(PassRegistry &)
FunctionPass * createPPCReduceCRLogicalsPass()
FunctionPass * createPPCISelDag(PPCTargetMachine &TM, CodeGenOptLevel OL)
createPPCISelDag - This pass converts a legalized DAG into a PowerPC-specific DAG,...
void initializePPCExpandAtomicPseudoPass(PassRegistry &)
FunctionPass * createPPCBranchCoalescingPass()
createPPCBranchCoalescingPass - returns an instance of the Branch Coalescing Pass
void initializePPCBSelPass(PassRegistry &)
FunctionPass * createPPCTOCRegDepsPass()
FunctionPass * createPPCCTRLoopsVerify()
void initializePPCBranchCoalescingPass(PassRegistry &)
void initializePPCBoolRetToIntPass(PassRegistry &)
void initializePPCMIPeepholePass(PassRegistry &)
void initializePPCVSXSwapRemovalPass(PassRegistry &)
char & PPCVSXFMAMutateID
char & PPCLowerMASSVEntriesID
InstructionSelector * createPPCInstructionSelector(const PPCTargetMachine &TM, const PPCSubtarget &Subtarget, const PPCRegisterBankInfo &RBI)
char & PPCGenScalarMASSEntriesID
void initializePPCLoopInstrFormPrepPass(PassRegistry &)
FunctionPass * createPPCExpandISELPass()
FunctionPass * createPPCBranchSelectionPass()
FunctionPass * createPPCBoolRetToIntPass()
FunctionPass * createPPCMIPeepholePass()
void initializePPCExpandISELPass(PassRegistry &)