LLVM  14.0.0git
SystemZConstantPoolValue.cpp
Go to the documentation of this file.
1 //===-- SystemZConstantPoolValue.cpp - SystemZ constant-pool value --------===//
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/FoldingSet.h"
11 #include "llvm/IR/DerivedTypes.h"
12 #include "llvm/IR/GlobalValue.h"
14 
15 using namespace llvm;
16 
20  : MachineConstantPoolValue(gv->getType()), GV(gv), Modifier(modifier) {}
21 
25  return new SystemZConstantPoolValue(GV, Modifier);
26 }
27 
29  Align Alignment) {
30  const std::vector<MachineConstantPoolEntry> &Constants = CP->getConstants();
31  for (unsigned I = 0, E = Constants.size(); I != E; ++I) {
32  if (Constants[I].isMachineConstantPoolEntry() &&
33  Constants[I].getAlign() >= Alignment) {
34  auto *ZCPV =
35  static_cast<SystemZConstantPoolValue *>(Constants[I].Val.MachineCPVal);
36  if (ZCPV->GV == GV && ZCPV->Modifier == Modifier)
37  return I;
38  }
39  }
40  return -1;
41 }
42 
44  ID.AddPointer(GV);
45  ID.AddInteger(Modifier);
46 }
47 
49  O << GV << "@" << int(Modifier);
50 }
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::dwarf::Constants
Constants
Definition: Dwarf.h:427
llvm::SystemZConstantPoolValue::print
void print(raw_ostream &O) const override
print - Implement operator<<
Definition: SystemZConstantPoolValue.cpp:48
llvm::MachineConstantPoolValue
Abstract base class for all machine specific constantpool value subclasses.
Definition: MachineConstantPool.h:35
llvm::SystemZCP::SystemZCPModifier
SystemZCPModifier
Definition: SystemZConstantPoolValue.h:20
llvm::SystemZConstantPoolValue
A SystemZ-specific constant pool value.
Definition: SystemZConstantPoolValue.h:32
llvm::Intrinsic::getType
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
Definition: Function.cpp:1335
GlobalValue.h
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
SystemZConstantPoolValue.h
int
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Definition: README.txt:536
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:192
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::SystemZConstantPoolValue::getExistingMachineCPValue
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
Definition: SystemZConstantPoolValue.cpp:28
llvm::MachineConstantPool
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
Definition: MachineConstantPool.h:117
llvm::SystemZConstantPoolValue::Create
static SystemZConstantPoolValue * Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier)
Definition: SystemZConstantPoolValue.cpp:23
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::FoldingSetNodeID
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition: FoldingSet.h:313
FoldingSet.h
llvm::HexagonISD::CP
@ CP
Definition: HexagonISelLowering.h:53
llvm::SystemZConstantPoolValue::addSelectionDAGCSEId
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
Definition: SystemZConstantPoolValue.cpp:43
llvm::getAlign
bool getAlign(const Function &F, unsigned index, unsigned &align)
Definition: NVPTXUtilities.cpp:284
DerivedTypes.h
raw_ostream.h
llvm::SystemZConstantPoolValue::SystemZConstantPoolValue
SystemZConstantPoolValue(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier)
Definition: SystemZConstantPoolValue.cpp:18
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37