let hasVerifier = 1;
}
-def fir_UndefOp : fir_OneResultOp<"undefined", [NoSideEffect]> {
+def fir_UndefOp : fir_OneResultOp<"undefined", [NoMemoryEffect]> {
let summary = "explicit undefined value of some type";
let description = [{
Constructs an ssa-value of the specified type with an undefined value.
let hasVerifier = 0;
}
-def fir_ZeroOp : fir_OneResultOp<"zero_bits", [NoSideEffect]> {
+def fir_ZeroOp : fir_OneResultOp<"zero_bits", [NoMemoryEffect]> {
let summary = "explicit polymorphic zero value of some type";
let description = [{
Constructs an ssa-value of the specified type with a value of zero for all
// Operations on !fir.box<T> type objects
//===----------------------------------------------------------------------===//
-def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> {
+def fir_EmboxOp : fir_Op<"embox", [NoMemoryEffect, AttrSizedOperandSegments]> {
let summary = "boxes a given reference and (optional) dimension information";
let description = [{
}];
}
-def fir_ReboxOp : fir_Op<"rebox", [NoSideEffect, AttrSizedOperandSegments]> {
+def fir_ReboxOp : fir_Op<"rebox", [NoMemoryEffect, AttrSizedOperandSegments]> {
let summary =
"create a box given another box and (optional) dimension information";
let hasVerifier = 1;
}
-def fir_EmboxCharOp : fir_Op<"emboxchar", [NoSideEffect]> {
+def fir_EmboxCharOp : fir_Op<"emboxchar", [NoMemoryEffect]> {
let summary = "boxes a given CHARACTER reference and its LEN parameter";
let description = [{
let hasVerifier = 1;
}
-def fir_EmboxProcOp : fir_Op<"emboxproc", [NoSideEffect]> {
+def fir_EmboxProcOp : fir_Op<"emboxproc", [NoMemoryEffect]> {
let summary = "boxes a given procedure and optional host context";
let description = [{
let hasVerifier = 1;
}
-def fir_UnboxCharOp : fir_SimpleOp<"unboxchar", [NoSideEffect]> {
+def fir_UnboxCharOp : fir_SimpleOp<"unboxchar", [NoMemoryEffect]> {
let summary = "unbox a boxchar value into a pair value";
let description = [{
let results = (outs fir_ReferenceType, AnyIntegerLike);
}
-def fir_UnboxProcOp : fir_SimpleOp<"unboxproc", [NoSideEffect]> {
+def fir_UnboxProcOp : fir_SimpleOp<"unboxproc", [NoMemoryEffect]> {
let summary = "unbox a boxproc value into a pair value";
let description = [{
let results = (outs FunctionType, fir_ReferenceType:$refTuple);
}
-def fir_BoxAddrOp : fir_SimpleOneResultOp<"box_addr", [NoSideEffect]> {
+def fir_BoxAddrOp : fir_SimpleOneResultOp<"box_addr", [NoMemoryEffect]> {
let summary = "return a memory reference to the boxed value";
let description = [{
let hasFolder = 1;
}
-def fir_BoxCharLenOp : fir_SimpleOp<"boxchar_len", [NoSideEffect]> {
+def fir_BoxCharLenOp : fir_SimpleOp<"boxchar_len", [NoMemoryEffect]> {
let summary = "return the LEN type parameter from a boxchar value";
let description = [{
let hasFolder = 1;
}
-def fir_BoxDimsOp : fir_Op<"box_dims", [NoSideEffect]> {
+def fir_BoxDimsOp : fir_Op<"box_dims", [NoMemoryEffect]> {
let summary = "return the dynamic dimension information for the boxed value";
let description = [{
}];
}
-def fir_BoxEleSizeOp : fir_SimpleOneResultOp<"box_elesize", [NoSideEffect]> {
+def fir_BoxEleSizeOp : fir_SimpleOneResultOp<"box_elesize", [NoMemoryEffect]> {
let summary = "return the size of an element of the boxed value";
let description = [{
let results = (outs AnyIntegerLike);
}
-def fir_BoxIsAllocOp : fir_SimpleOp<"box_isalloc", [NoSideEffect]> {
+def fir_BoxIsAllocOp : fir_SimpleOp<"box_isalloc", [NoMemoryEffect]> {
let summary = "is the boxed value an ALLOCATABLE?";
let description = [{
let results = (outs BoolLike);
}
-def fir_BoxIsArrayOp : fir_SimpleOp<"box_isarray", [NoSideEffect]> {
+def fir_BoxIsArrayOp : fir_SimpleOp<"box_isarray", [NoMemoryEffect]> {
let summary = "is the boxed value an array?";
let description = [{
let results = (outs BoolLike);
}
-def fir_BoxIsPtrOp : fir_SimpleOp<"box_isptr", [NoSideEffect]> {
+def fir_BoxIsPtrOp : fir_SimpleOp<"box_isptr", [NoMemoryEffect]> {
let summary = "is the boxed value a POINTER?";
let description = [{
let results = (outs BoolLike);
}
-def fir_BoxProcHostOp : fir_SimpleOp<"boxproc_host", [NoSideEffect]> {
+def fir_BoxProcHostOp : fir_SimpleOp<"boxproc_host", [NoMemoryEffect]> {
let summary = "returns the host instance pointer (or null)";
let description = [{
let results = (outs fir_ReferenceType);
}
-def fir_BoxRankOp : fir_SimpleOneResultOp<"box_rank", [NoSideEffect]> {
+def fir_BoxRankOp : fir_SimpleOneResultOp<"box_rank", [NoMemoryEffect]> {
let summary = "return the number of dimensions for the boxed value";
let description = [{
let results = (outs AnyIntegerType);
}
-def fir_BoxTypeDescOp : fir_SimpleOneResultOp<"box_tdesc", [NoSideEffect]> {
+def fir_BoxTypeDescOp : fir_SimpleOneResultOp<"box_tdesc", [NoMemoryEffect]> {
let summary = "return the type descriptor for the boxed value";
let description = [{
}
def fir_ArrayFetchOp : fir_Op<"array_fetch", [AttrSizedOperandSegments,
- NoSideEffect]> {
+ NoMemoryEffect]> {
let summary = "Fetch the value of an element of an array value";
}
def fir_ArrayUpdateOp : fir_Op<"array_update", [AttrSizedOperandSegments,
- NoSideEffect]> {
+ NoMemoryEffect]> {
let summary = "Update the value of an element of an array value";
}
def fir_ArrayModifyOp : fir_Op<"array_modify", [AttrSizedOperandSegments,
- NoSideEffect]> {
+ NoMemoryEffect]> {
let summary = "Get an address for an array value to modify it.";
let description = [{
}
def fir_ArrayAccessOp : fir_Op<"array_access", [AttrSizedOperandSegments,
- NoSideEffect]> {
+ NoMemoryEffect]> {
let summary = "Fetch the reference of an element of an array value";
let description = [{
let hasVerifier = 1;
}
-def fir_ArrayAmendOp : fir_Op<"array_amend", [NoSideEffect]> {
+def fir_ArrayAmendOp : fir_Op<"array_amend", [NoMemoryEffect]> {
let summary = "Mark an array value as having been changed by reference.";
let description = [{
//===----------------------------------------------------------------------===//
def fir_ArrayCoorOp : fir_Op<"array_coor",
- [NoSideEffect, AttrSizedOperandSegments]> {
+ [NoMemoryEffect, AttrSizedOperandSegments]> {
let summary = "Find the coordinate of an element of an array";
let hasVerifier = 1;
}
-def fir_CoordinateOp : fir_Op<"coordinate_of", [NoSideEffect]> {
+def fir_CoordinateOp : fir_Op<"coordinate_of", [NoMemoryEffect]> {
let summary = "Finds the coordinate (location) of a value in memory";
];
}
-def fir_ExtractValueOp : fir_OneResultOp<"extract_value", [NoSideEffect]> {
+def fir_ExtractValueOp : fir_OneResultOp<"extract_value", [NoMemoryEffect]> {
let summary = "Extract a value from an aggregate SSA-value";
let description = [{
}];
}
-def fir_FieldIndexOp : fir_OneResultOp<"field_index", [NoSideEffect]> {
+def fir_FieldIndexOp : fir_OneResultOp<"field_index", [NoMemoryEffect]> {
let summary = "create a field index value from a field identifier";
let description = [{
}];
}
-def fir_ShapeOp : fir_Op<"shape", [NoSideEffect]> {
+def fir_ShapeOp : fir_Op<"shape", [NoMemoryEffect]> {
let summary = "generate an abstract shape vector of type `!fir.shape`";
let hasVerifier = 1;
}
-def fir_ShapeShiftOp : fir_Op<"shape_shift", [NoSideEffect]> {
+def fir_ShapeShiftOp : fir_Op<"shape_shift", [NoMemoryEffect]> {
let summary = [{
generate an abstract shape and shift vector of type `!fir.shapeshift`
}];
}
-def fir_ShiftOp : fir_Op<"shift", [NoSideEffect]> {
+def fir_ShiftOp : fir_Op<"shift", [NoMemoryEffect]> {
let summary = "generate an abstract shift vector of type `!fir.shift`";
let hasVerifier = 1;
}
-def fir_SliceOp : fir_Op<"slice", [NoSideEffect, AttrSizedOperandSegments]> {
+def fir_SliceOp : fir_Op<"slice", [NoMemoryEffect, AttrSizedOperandSegments]> {
let summary = "generate an abstract slice vector of type `!fir.slice`";
}];
}
-def fir_InsertValueOp : fir_OneResultOp<"insert_value", [NoSideEffect]> {
+def fir_InsertValueOp : fir_OneResultOp<"insert_value", [NoMemoryEffect]> {
let summary = "insert a new sub-value into a copy of an existing aggregate";
let description = [{
let hasCanonicalizer = 1;
}
-def fir_InsertOnRangeOp : fir_OneResultOp<"insert_on_range", [NoSideEffect]> {
+def fir_InsertOnRangeOp : fir_OneResultOp<"insert_on_range", [NoMemoryEffect]> {
let summary = "insert sub-value into a range on an existing sequence";
let description = [{
let hasVerifier = 1;
}
-def fir_LenParamIndexOp : fir_OneResultOp<"len_param_index", [NoSideEffect]> {
+def fir_LenParamIndexOp : fir_OneResultOp<"len_param_index", [NoMemoryEffect]> {
let summary =
"create a field index value from a LEN type parameter identifier";
//===----------------------------------------------------------------------===//
def fir_ResultOp : fir_Op<"result",
- [NoSideEffect, ReturnLike, Terminator,
+ [NoMemoryEffect, ReturnLike, Terminator,
ParentOneOf<["IfOp", "DoLoopOp", "IterWhileOp"]>]> {
let summary = "special terminator for use in fir region operations";
class region_Op<string mnemonic, list<Trait> traits = []> :
fir_Op<mnemonic,
- !listconcat(traits, [FirRegionTerminator, RecursiveSideEffects])> {
+ !listconcat(traits, [FirRegionTerminator, RecursivelySpeculatable,
+ RecursiveMemoryEffects])> {
let hasCustomAssemblyFormat = 1;
let hasVerifier = 1;
}
// Constant operations that support Fortran
-def fir_StringLitOp : fir_Op<"string_lit", [NoSideEffect]> {
+def fir_StringLitOp : fir_Op<"string_lit", [NoMemoryEffect]> {
let summary = "create a string literal constant";
let description = [{
class fir_ArithmeticOp<string mnemonic, list<Trait> traits = []> :
fir_Op<mnemonic,
- !listconcat(traits, [NoSideEffect, SameOperandsAndResultType])>,
+ !listconcat(traits, [NoMemoryEffect, SameOperandsAndResultType])>,
Results<(outs AnyType:$result)> {
let assemblyFormat = "operands attr-dict `:` type($result)";
}
class fir_UnaryArithmeticOp<string mnemonic, list<Trait> traits = []> :
fir_Op<mnemonic,
- !listconcat(traits, [NoSideEffect, SameOperandsAndResultType])>,
+ !listconcat(traits, [NoMemoryEffect, SameOperandsAndResultType])>,
Results<(outs AnyType:$result)> {
let assemblyFormat = "operands attr-dict `:` type($result)";
}
-def fir_ConstcOp : fir_Op<"constc", [NoSideEffect]> {
+def fir_ConstcOp : fir_Op<"constc", [NoMemoryEffect]> {
let summary = "create a complex constant";
let description = [{
// Pow is a builtin call and not a primitive
def fir_CmpcOp : fir_Op<"cmpc",
- [NoSideEffect, SameTypeOperands, SameOperandsAndResultShape]> {
+ [NoMemoryEffect, SameTypeOperands, SameOperandsAndResultShape]> {
let summary = "complex floating-point comparison operator";
let description = [{
// Other misc. operations
-def fir_AddrOfOp : fir_OneResultOp<"address_of", [NoSideEffect]> {
+def fir_AddrOfOp : fir_OneResultOp<"address_of", [NoMemoryEffect]> {
let summary = "convert a symbol to an SSA value";
let description = [{
let assemblyFormat = "`(` $symbol `)` attr-dict `:` type($resTy)";
}
-def fir_ConvertOp : fir_OneResultOp<"convert", [NoSideEffect]> {
+def fir_ConvertOp : fir_OneResultOp<"convert", [NoMemoryEffect]> {
let summary = "encapsulates all Fortran entity type conversions";
let description = [{
let convertFromStorage = "$_self.getValue().cast<mlir::Type>()";
}
-def fir_GenTypeDescOp : fir_OneResultOp<"gentypedesc", [NoSideEffect]> {
+def fir_GenTypeDescOp : fir_OneResultOp<"gentypedesc", [NoMemoryEffect]> {
let summary = "generate a type descriptor for a given type";
let description = [{
Generates a constant object that is an abstract type descriptor of the
}
def fir_NoReassocOp : fir_OneResultOp<"no_reassoc",
- [NoSideEffect, SameOperandsAndResultType]> {
+ [NoMemoryEffect, SameOperandsAndResultType]> {
let summary = "synthetic op to prevent reassociation";
let description = [{
Primitive operation meant to intrusively prevent operator reassociation.
}];
}
-def fir_AbsentOp : fir_OneResultOp<"absent", [NoSideEffect]> {
+def fir_AbsentOp : fir_OneResultOp<"absent", [NoMemoryEffect]> {
let summary = "create value to be passed for absent optional function argument";
let description = [{
Given the type of a function argument, create a value that will signal that
let assemblyFormat = "type($intype) attr-dict";
}
-def fir_IsPresentOp : fir_SimpleOp<"is_present", [NoSideEffect]> {
+def fir_IsPresentOp : fir_SimpleOp<"is_present", [NoMemoryEffect]> {
let summary = "is this optional function argument present?";
let description = [{