LLVM  9.0.0svn
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 
17 #include "llvm/Support/CodeGen.h"
19 
20 // GCC #defines PPC on Linux but we use it as our namespace name
21 #undef PPC
22 
23 namespace llvm {
24  class PPCTargetMachine;
25  class PassRegistry;
26  class FunctionPass;
27  class MachineInstr;
28  class MachineOperand;
29  class AsmPrinter;
30  class MCInst;
31  class MCOperand;
32 
33  FunctionPass *createPPCCTRLoops();
34 #ifndef NDEBUG
35  FunctionPass *createPPCCTRLoopsVerify();
36 #endif
37  FunctionPass *createPPCLoopPreIncPrepPass(PPCTargetMachine &TM);
38  FunctionPass *createPPCTOCRegDepsPass();
39  FunctionPass *createPPCEarlyReturnPass();
40  FunctionPass *createPPCVSXCopyPass();
41  FunctionPass *createPPCVSXFMAMutatePass();
42  FunctionPass *createPPCVSXSwapRemovalPass();
43  FunctionPass *createPPCReduceCRLogicalsPass();
44  FunctionPass *createPPCMIPeepholePass();
45  FunctionPass *createPPCBranchSelectionPass();
46  FunctionPass *createPPCBranchCoalescingPass();
47  FunctionPass *createPPCQPXLoadSplatPass();
48  FunctionPass *createPPCISelDag(PPCTargetMachine &TM, CodeGenOpt::Level OL);
49  FunctionPass *createPPCTLSDynamicCallPass();
50  FunctionPass *createPPCBoolRetToIntPass();
51  FunctionPass *createPPCExpandISELPass();
52  FunctionPass *createPPCPreEmitPeepholePass();
53  void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
54  AsmPrinter &AP, bool isDarwin);
55  bool LowerPPCMachineOperandToMCOperand(const MachineOperand &MO,
56  MCOperand &OutMO, AsmPrinter &AP,
57  bool isDarwin);
58 
59  void initializePPCCTRLoopsPass(PassRegistry&);
60 #ifndef NDEBUG
61  void initializePPCCTRLoopsVerifyPass(PassRegistry&);
62 #endif
63  void initializePPCLoopPreIncPrepPass(PassRegistry&);
64  void initializePPCTOCRegDepsPass(PassRegistry&);
65  void initializePPCEarlyReturnPass(PassRegistry&);
66  void initializePPCVSXCopyPass(PassRegistry&);
67  void initializePPCVSXFMAMutatePass(PassRegistry&);
68  void initializePPCVSXSwapRemovalPass(PassRegistry&);
69  void initializePPCReduceCRLogicalsPass(PassRegistry&);
70  void initializePPCBSelPass(PassRegistry&);
71  void initializePPCBranchCoalescingPass(PassRegistry&);
72  void initializePPCQPXLoadSplatPass(PassRegistry&);
73  void initializePPCBoolRetToIntPass(PassRegistry&);
74  void initializePPCExpandISELPass(PassRegistry &);
75  void initializePPCPreEmitPeepholePass(PassRegistry &);
76  void initializePPCTLSDynamicCallPass(PassRegistry &);
77  void initializePPCMIPeepholePass(PassRegistry&);
78 
79  extern char &PPCVSXFMAMutateID;
80 
81  namespace PPCII {
82 
83  /// Target Operand Flag enum.
84  enum TOF {
85  //===------------------------------------------------------------------===//
86  // PPC Specific MachineOperand flags.
88 
89  /// On a symbol operand "FOO", this indicates that the reference is actually
90  /// to "FOO@plt". This is used for calls and jumps to external functions on
91  /// for PIC calls on Linux and ELF systems.
92  MO_PLT = 1,
93 
94  /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
95  /// the function's picbase, e.g. lo16(symbol-picbase).
97 
98  /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
99  /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
101 
102  /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
103  /// symbol with hidden visibility. This causes a different kind of
104  /// non-lazy-pointer to be generated.
106 
107  /// The next are not flags but distinct values.
109 
110  /// MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
111  MO_LO = 1 << 4,
112  MO_HA = 2 << 4,
113 
114  MO_TPREL_LO = 4 << 4,
115  MO_TPREL_HA = 3 << 4,
116 
117  /// These values identify relocations on immediates folded
118  /// into memory operations.
119  MO_DTPREL_LO = 5 << 4,
120  MO_TLSLD_LO = 6 << 4,
121  MO_TOC_LO = 7 << 4,
122 
123  // Symbol for VK_PPC_TLS fixup attached to an ADD instruction
124  MO_TLS = 8 << 4
125  };
126  } // end namespace PPCII
127 
128 } // end namespace llvm;
129 
130 #endif
void initializePPCTOCRegDepsPass(PassRegistry &)
void initializePPCVSXCopyPass(PassRegistry &)
This class represents lattice values for constants.
Definition: AllocatorList.h:23
FunctionPass * createPPCVSXSwapRemovalPass()
void initializePPCCTRLoopsVerifyPass(PassRegistry &)
void initializePPCTLSDynamicCallPass(PassRegistry &)
FunctionPass * createPPCVSXFMAMutatePass()
void initializePPCQPXLoadSplatPass(PassRegistry &)
MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
Definition: PPC.h:111
void initializePPCMIPeepholePass(PassRegistry &)
char & PPCVSXFMAMutateID
TOF
Target Operand Flag enum.
Definition: PPC.h:84
FunctionPass * createPPCTLSDynamicCallPass()
FunctionPass * createPPCTOCRegDepsPass()
void initializePPCBSelPass(PassRegistry &)
FunctionPass * createPPCCTRLoops()
void initializePPCReduceCRLogicalsPass(PassRegistry &)
void initializePPCBranchCoalescingPass(PassRegistry &)
void initializePPCLoopPreIncPrepPass(PassRegistry &)
FunctionPass * createPPCReduceCRLogicalsPass()
FunctionPass * createPPCBranchCoalescingPass()
createPPCBranchCoalescingPass - returns an instance of the Branch Coalescing Pass ...
MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a symbol with hidden visibility...
Definition: PPC.h:105
FunctionPass * createPPCCTRLoopsVerify()
FunctionPass * createPPCBoolRetToIntPass()
void initializePPCVSXSwapRemovalPass(PassRegistry &)
FunctionPass * createPPCBranchSelectionPass()
void initializePPCBoolRetToIntPass(PassRegistry &)
FunctionPass * createPPCEarlyReturnPass()
MO_NLP_FLAG - If this bit is set, the symbol reference is actually to the non_lazy_ptr for the global...
Definition: PPC.h:100
void initializePPCVSXFMAMutatePass(PassRegistry &)
static bool isDarwin(object::Archive::Kind Kind)
void initializePPCEarlyReturnPass(PassRegistry &)
FunctionPass * createPPCVSXCopyPass()
void initializePPCCTRLoopsPass(PassRegistry &)
The next are not flags but distinct values.
Definition: PPC.h:108
void initializePPCExpandISELPass(PassRegistry &)
These values identify relocations on immediates folded into memory operations.
Definition: PPC.h:119
bool LowerPPCMachineOperandToMCOperand(const MachineOperand &MO, MCOperand &OutMO, AsmPrinter &AP, bool isDarwin)
void initializePPCPreEmitPeepholePass(PassRegistry &)
FunctionPass * createPPCISelDag(PPCTargetMachine &TM, CodeGenOpt::Level OL)
createPPCISelDag - This pass converts a legalized DAG into a PowerPC-specific DAG, ready for instruction scheduling.
FunctionPass * createPPCQPXLoadSplatPass()
FunctionPass * createPPCMIPeepholePass()
FunctionPass * createPPCLoopPreIncPrepPass(PPCTargetMachine &TM)
FunctionPass * createPPCPreEmitPeepholePass()
void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, AsmPrinter &AP, bool isDarwin)
IRTranslator LLVM IR MI
On a symbol operand "FOO", this indicates that the reference is actually to "FOO@plt".
Definition: PPC.h:92
MO_PIC_FLAG - If this bit is set, the symbol reference is relative to the function&#39;s picbase...
Definition: PPC.h:96
FunctionPass * createPPCExpandISELPass()