LLVM  12.0.0git
PPCMachineFunctionInfo.cpp
Go to the documentation of this file.
1 //===-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --------===//
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 
10 #include "llvm/ADT/Twine.h"
11 #include "llvm/IR/DataLayout.h"
12 #include "llvm/MC/MCContext.h"
14 
15 using namespace llvm;
17  "ppc-disable-non-volatile-cr",
18  cl::desc("Disable the use of non-volatile CR register fields"),
19  cl::init(false), cl::Hidden);
20 
21 void PPCFunctionInfo::anchor() {}
23  : DisableNonVolatileCR(PPCDisableNonVolatileCR) {}
24 
26  const DataLayout &DL = MF.getDataLayout();
28  Twine(MF.getFunctionNumber()) +
29  "$poff");
30 }
31 
33  const DataLayout &DL = MF.getDataLayout();
35  "func_gep" +
36  Twine(MF.getFunctionNumber()));
37 }
38 
40  const DataLayout &DL = MF.getDataLayout();
42  "func_lep" +
43  Twine(MF.getFunctionNumber()));
44 }
45 
47  const DataLayout &DL = MF.getDataLayout();
49  "func_toc" +
50  Twine(MF.getFunctionNumber()));
51 }
52 
54  for (const std::pair<Register, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
55  if (LiveIn.first == VReg)
56  return LiveIn.second.isSExt();
57  return false;
58 }
59 
61  for (const std::pair<Register, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
62  if (LiveIn.first == VReg)
63  return LiveIn.second.isZExt();
64  return false;
65 }
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:111
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
StringRef getPrivateGlobalPrefix() const
Definition: DataLayout.h:322
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
bool isLiveInSExt(Register VReg) const
This function returns true if the specified vreg is a live-in register and sign-extended.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
MCContext & getContext() const
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:434
bool isLiveInZExt(Register VReg) const
This function returns true if the specified vreg is a live-in register and zero-extended.
static cl::opt< bool > PPCDisableNonVolatileCR("ppc-disable-non-volatile-cr", cl::desc("Disable the use of non-volatile CR register fields"), cl::init(false), cl::Hidden)
PPCFunctionInfo(const MachineFunction &MF)
MCSymbol * getLocalEPSymbol(MachineFunction &MF) const
MCSymbol * getTOCOffsetSymbol(MachineFunction &MF) const
MCSymbol * getGlobalEPSymbol(MachineFunction &MF) const
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition: MCContext.cpp:133
MCSymbol * getPICOffsetSymbol(MachineFunction &MF) const
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL