FLANG
FIRContext.h
1//===-- Optimizer/Support/FIRContext.h --------------------------*- C++ -*-===//
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// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
10//
11//===----------------------------------------------------------------------===//
15//===----------------------------------------------------------------------===//
16
17#ifndef FORTRAN_OPTIMIZER_SUPPORT_FIRCONTEXT_H
18#define FORTRAN_OPTIMIZER_SUPPORT_FIRCONTEXT_H
19
20#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
21#include "llvm/ADT/StringRef.h"
22#include "llvm/Support/CodeGen.h"
23#include "llvm/TargetParser/Triple.h"
24
25namespace mlir {
26class ModuleOp;
27class Operation;
28} // namespace mlir
29
30namespace fir {
31class KindMapping;
32struct NameUniquer;
33
36void setTargetTriple(mlir::ModuleOp mod, llvm::StringRef triple);
37
39llvm::Triple getTargetTriple(mlir::ModuleOp mod);
40
43void setKindMapping(mlir::ModuleOp mod, KindMapping &kindMap);
44
47KindMapping getKindMapping(mlir::ModuleOp mod);
48
53KindMapping getKindMapping(mlir::Operation *op);
54
57void setTargetCPU(mlir::ModuleOp mod, llvm::StringRef cpu);
58
60llvm::StringRef getTargetCPU(mlir::ModuleOp mod);
61
64void setAtomicIgnoreDenormalMode(mlir::ModuleOp mod, bool value);
67bool getAtomicIgnoreDenormalMode(mlir::ModuleOp mod);
70void setAtomicFineGrainedMemory(mlir::ModuleOp mod, bool value);
73bool getAtomicFineGrainedMemory(mlir::ModuleOp mod);
76void setAtomicRemoteMemory(mlir::ModuleOp mod, bool value);
79bool getAtomicRemoteMemory(mlir::ModuleOp mod);
80
83void setTuneCPU(mlir::ModuleOp mod, llvm::StringRef cpu);
84
86llvm::StringRef getTuneCPU(mlir::ModuleOp mod);
87
89void setTargetFeatures(mlir::ModuleOp mod, llvm::StringRef features);
90
92mlir::LLVM::TargetFeaturesAttr getTargetFeatures(mlir::ModuleOp mod);
93
95void setIdent(mlir::ModuleOp mod, llvm::StringRef ident);
96
98llvm::StringRef getIdent(mlir::ModuleOp mod);
99
101void setCommandline(mlir::ModuleOp mod, llvm::StringRef cmdLine);
102
104llvm::StringRef getCommandline(mlir::ModuleOp mod);
105
107void setRelocationModel(mlir::ModuleOp mod, llvm::Reloc::Model rm);
108
110llvm::Reloc::Model getRelocationModel(mlir::ModuleOp mod);
111
113void setIsPIE(mlir::ModuleOp mod, bool value);
114
116bool getIsPIE(mlir::ModuleOp mod);
117
124std::string determineTargetTriple(llvm::StringRef triple);
125
126} // namespace fir
127
128#endif // FORTRAN_OPTIMIZER_SUPPORT_FIRCONTEXT_H
Definition KindMapping.h:48
Definition AbstractConverter.h:37
llvm::StringRef getTuneCPU(mlir::ModuleOp mod)
Get the tune CPU string from the Module or return a null reference.
Definition FIRContext.cpp:142
llvm::StringRef getIdent(mlir::ModuleOp mod)
Get the compiler identifier from the Module.
Definition FIRContext.cpp:177
KindMapping getKindMapping(mlir::ModuleOp mod)
Definition FIRContext.cpp:43
mlir::LLVM::TargetFeaturesAttr getTargetFeatures(mlir::ModuleOp mod)
Get the target features from the Module.
Definition FIRContext.cpp:160
void setIsPIE(mlir::ModuleOp mod, bool value)
Set whether the module is compiled as a position-independent executable.
Definition FIRContext.cpp:222
llvm::Reloc::Model getRelocationModel(mlir::ModuleOp mod)
Get the relocation model from the Module (defaults to PIC).
Definition FIRContext.cpp:209
void setIdent(mlir::ModuleOp mod, llvm::StringRef ident)
Set the compiler identifier for the module.
Definition FIRContext.cpp:168
llvm::StringRef getCommandline(mlir::ModuleOp mod)
Get the command line used in this invocation.
Definition FIRContext.cpp:193
void setKindMapping(mlir::ModuleOp mod, KindMapping &kindMap)
Definition FIRContext.cpp:36
void setAtomicRemoteMemory(mlir::ModuleOp mod, bool value)
Definition FIRContext.cpp:128
bool getAtomicIgnoreDenormalMode(mlir::ModuleOp mod)
Definition FIRContext.cpp:104
bool getAtomicRemoteMemory(mlir::ModuleOp mod)
Definition FIRContext.cpp:138
void setTargetCPU(mlir::ModuleOp mod, llvm::StringRef cpu)
Definition FIRContext.cpp:65
void setTuneCPU(mlir::ModuleOp mod, llvm::StringRef cpu)
Definition FIRContext.cpp:82
std::string determineTargetTriple(llvm::StringRef triple)
Definition FIRContext.cpp:234
bool getIsPIE(mlir::ModuleOp mod)
Get whether the module is compiled as a position-independent executable.
Definition FIRContext.cpp:232
bool getAtomicFineGrainedMemory(mlir::ModuleOp mod)
Definition FIRContext.cpp:121
void setCommandline(mlir::ModuleOp mod, llvm::StringRef cmdLine)
Set the command line used in this invocation.
Definition FIRContext.cpp:184
void setAtomicIgnoreDenormalMode(mlir::ModuleOp mod, bool value)
Definition FIRContext.cpp:94
void setTargetTriple(mlir::ModuleOp mod, llvm::StringRef triple)
Definition FIRContext.cpp:20
llvm::StringRef getTargetCPU(mlir::ModuleOp mod)
Get the target CPU string from the Module or return a null reference.
Definition FIRContext.cpp:73
void setAtomicFineGrainedMemory(mlir::ModuleOp mod, bool value)
Definition FIRContext.cpp:111
llvm::Triple getTargetTriple(mlir::ModuleOp mod)
Get the Triple instance from the Module or return the default Triple.
Definition FIRContext.cpp:26
void setTargetFeatures(mlir::ModuleOp mod, llvm::StringRef features)
Set the target features for the module.
Definition FIRContext.cpp:151
void setRelocationModel(mlir::ModuleOp mod, llvm::Reloc::Model rm)
Set the relocation model for the module.
Definition FIRContext.cpp:202
Definition AbstractConverter.h:32
Definition InternalNames.h:45