LLVM 22.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/GlobalValue.h"
13
14using namespace llvm;
15
20
26
28 Align Alignment) {
29 const std::vector<MachineConstantPoolEntry> &Constants = CP->getConstants();
30 for (unsigned I = 0, E = Constants.size(); I != E; ++I) {
31 if (Constants[I].isMachineConstantPoolEntry() &&
32 Constants[I].getAlign() >= Alignment) {
33 auto *ZCPV =
34 static_cast<SystemZConstantPoolValue *>(Constants[I].Val.MachineCPVal);
35 if (ZCPV->GV == GV && ZCPV->Modifier == Modifier)
36 return I;
37 }
38 }
39 return -1;
40}
41
43 ID.AddPointer(GV);
44 ID.AddInteger(Modifier);
45}
46
48 O << GV << "@" << int(Modifier);
49}
This file defines a hash set that can be used to remove duplication of nodes in a graph.
#define I(x, y, z)
Definition MD5.cpp:58
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition FoldingSet.h:330
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
A SystemZ-specific constant pool value.
void print(raw_ostream &O) const override
print - Implement operator<<
static SystemZConstantPoolValue * Create(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier)
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
SystemZConstantPoolValue(const GlobalValue *GV, SystemZCP::SystemZCPModifier Modifier)
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
MaybeAlign getAlign(const CallInst &I, unsigned Index)
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39