LLVM 24.0.0git
MemCacheHint.h
Go to the documentation of this file.
1//===- MemCacheHint.h - Cache hint metadata helpers ----------------------===//
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#ifndef LLVM_IR_MEMCACHEHINT_H
10#define LLVM_IR_MEMCACHEHINT_H
11
12#include "llvm/ADT/ArrayRef.h"
14
15namespace llvm {
16
17class Instruction;
18class MDNode;
19class Value;
20
21/// Return the hint payload for operand \p OperandNo of \p I, or nullptr if
22/// absent. Operand numbers are argument indices for intrinsic calls and
23/// instruction operand indices otherwise.
24LLVM_ABI MDNode *getMemCacheHint(const Instruction &I, unsigned OperandNo = 0);
25
26/// Set the hint payload for operand \p OperandNo of \p I, preserving other
27/// operands' hints. A null \p Hint removes this operand's entry. Entries are
28/// kept in increasing operand order; removing the last entry clears the
29/// attachment. Operand numbering follows getMemCacheHint().
30LLVM_ABI void setMemCacheHint(Instruction &I, unsigned OperandNo, MDNode *Hint);
31
32/// Copy identical source cache-hint attachments to \p Dest, or clear its
33/// attachment if propagation fails. All accesses must be supported reads (loads
34/// or masked loads/gathers) or writes (stores or masked stores/scatters), with
35/// matching pointer operand positions.
37 ArrayRef<Value *> Sources);
38
39} // namespace llvm
40
41#endif // LLVM_IR_MEMCACHEHINT_H
#define LLVM_ABI
Definition Compiler.h:211
#define I(x, y, z)
Definition MD5.cpp:57
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Metadata node.
Definition Metadata.h:1081
LLVM Value Representation.
Definition Value.h:75
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void setMemCacheHint(Instruction &I, unsigned OperandNo, MDNode *Hint)
Set the hint payload for operand OperandNo of I, preserving other operands' hints.
LLVM_ABI void propagateMemCacheHint(Instruction &Dest, ArrayRef< Value * > Sources)
Copy identical source cache-hint attachments to Dest, or clear its attachment if propagation fails.
LLVM_ABI MDNode * getMemCacheHint(const Instruction &I, unsigned OperandNo=0)
Return the hint payload for operand OperandNo of I, or nullptr if absent.