13#ifndef CLANG_CIR_DIALECT_IR_CIRDIALECT_H
14#define CLANG_CIR_DIALECT_IR_CIRDIALECT_H
16#include "mlir/IR/Builders.h"
17#include "mlir/IR/BuiltinOps.h"
18#include "mlir/IR/BuiltinTypes.h"
19#include "mlir/IR/Dialect.h"
20#include "mlir/IR/OpDefinition.h"
21#include "mlir/Interfaces/CallInterfaces.h"
22#include "mlir/Interfaces/ControlFlowInterfaces.h"
23#include "mlir/Interfaces/FunctionInterfaces.h"
24#include "mlir/Interfaces/InferTypeOpInterface.h"
25#include "mlir/Interfaces/LoopLikeInterface.h"
26#include "mlir/Interfaces/MemorySlotInterfaces.h"
27#include "mlir/Interfaces/SideEffectInterfaces.h"
30#include "clang/CIR/Dialect/IR/CIROpsDialect.h.inc"
38 llvm::function_ref<void(mlir::OpBuilder &, mlir::Location)>;
40 mlir::OpBuilder &, mlir::Location, mlir::OperationState &)>;
48 :
public mlir::SideEffects::Resource::Base<
49 FloatingPointEnvironmentResource> {
50 mlir::StringRef
getName() const final {
return "FloatingPointEnvironment"; }
54template <
typename ConcreteType>
60 FPEnvConstrainedOpInterface fenvOp = getFenvOp();
61 if (fenvOp.getFenvExceptionMode() == cir::FPExceptionMode::Masked &&
62 !fenvOp.getFenvStrictExcept())
63 return mlir::Speculation::Speculatable;
65 return mlir::Speculation::NotSpeculatable;
70 if (!getFenvOp().getFenvAttr())
72 effects.emplace_back(mlir::MemoryEffects::Read::get(),
73 FloatingPointEnvironmentResource::get());
74 effects.emplace_back(mlir::MemoryEffects::Write::get(),
75 FloatingPointEnvironmentResource::get());
79 FPEnvConstrainedOpInterface getFenvOp() {
80 return mlir::cast<FPEnvConstrainedOpInterface>(this->getOperation());
86RecordLayoutAttr
getRecordLayout(mlir::ModuleOp mod, mlir::StringAttr name);
97#include "clang/CIR/Dialect/IR/CIROps.h.inc"
llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> BuilderCallbackRef
llvm::function_ref< void( mlir::OpBuilder &, mlir::Location, mlir::OperationState &)> BuilderOpStateCallbackRef
mlir::Speculation::Speculatability getSpeculatability()
void getEffects(llvm::SmallVectorImpl< mlir::MemoryEffects::EffectInstance > &effects)
RecordLayoutAttr tryGetRecordLayout(mlir::ModuleOp mod, mlir::StringAttr name)
Same lookup as getRecordLayout, but returns a null attribute instead of asserting when the record has...
RecordLayoutAttr getRecordLayout(mlir::ModuleOp mod, mlir::StringAttr name)
Look up the RecordLayoutAttr for a named record in the module's cir.record_layouts dictionary.
void buildTerminatedBody(mlir::OpBuilder &builder, mlir::Location loc)
The process floating-point environment, including its rounding mode and exception state.
bool isAddressable() const final
mlir::StringRef getName() const final