LLVM 24.0.0git
PISACacheCtrlMMRA.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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/// \file
10/// This file declares PISA cache-control MMRA metadata handling.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_PISA_PISACACHECTRLMMRA_H
15#define LLVM_LIB_TARGET_PISA_PISACACHECTRLMMRA_H
16
17#include <optional>
18
19namespace llvm {
20class Instruction;
21
22namespace PISA {
23
24// Reads the cache-ctrl integer from the "pisa.cache.ctrl" MMRA tag on I.
25// Returns std::nullopt if the tag is absent or malformed. If more than
26// one distinct cache-ctrl value is attached (e.g. a passthrough merge of
27// two memory ops with different cache hints by an upstream pass such as
28// the LoadStoreVectorizer), emits a warning through the LLVMContext
29// listing the conflicting values and keeps one of them so the compiler
30// can still produce valid output.
31std::optional<unsigned> getCacheCtrlFromMMRA(const Instruction &I);
32
33// Sets the "pisa.cache.ctrl" MMRA tag on I to Value. Preserves all
34// other MMRA tags already on I, replacing any prior cache-ctrl tag.
35void setCacheCtrlMMRA(Instruction &I, unsigned Value);
36
37// Copies the "pisa.cache.ctrl" MMRA tag from From to To if present,
38// preserving all other MMRA tags already on To.
39void copyCacheCtrlMMRA(const Instruction &From, Instruction &To);
40
41} // namespace PISA
42} // namespace llvm
43
44#endif // LLVM_LIB_TARGET_PISA_PISACACHECTRLMMRA_H
#define I(x, y, z)
Definition MD5.cpp:57
void copyCacheCtrlMMRA(const Instruction &From, Instruction &To)
void setCacheCtrlMMRA(Instruction &I, unsigned Value)
std::optional< unsigned > getCacheCtrlFromMMRA(const Instruction &I)
This is an optimization pass for GlobalISel generic memory operations.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
Definition InstrProf.h:143