Repository navigation
Make Flang dialect assembly formats strict properties compatible - #226602
Conversation
|
@llvm/pr-subscribers-flang-driver @llvm/pr-subscribers-flang-semantics Author: Mehdi Amini (joker-eph) ChangesEnable strict properties in FIR, HLFIR, CUF, MIF, and FIRCG. Bind inherent attributes explicitly in custom formats and update Flang assembly checks. Assisted-by: Codex Patch is 6.66 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/226602.diff 1049 Files Affected:
diff --git a/flang/include/flang/Optimizer/Dialect/CUF/CUFDialect.td b/flang/include/flang/Optimizer/Dialect/CUF/CUFDialect.td
index 0cabd55f1ea5ab..4bdabef713353c 100644
--- a/flang/include/flang/Optimizer/Dialect/CUF/CUFDialect.td
+++ b/flang/include/flang/Optimizer/Dialect/CUF/CUFDialect.td
@@ -20,6 +20,7 @@ include "mlir/IR/OpBase.td"
def CUFDialect : Dialect {
let name = "cuf";
+ let useStrictPropertiesInAssemblyFormat = 1;
let summary = "CUDA Fortran dialect";
diff --git a/flang/include/flang/Optimizer/Dialect/CUF/CUFOps.td b/flang/include/flang/Optimizer/Dialect/CUF/CUFOps.td
index bae9794d91f91d..6625b343d04393 100644
--- a/flang/include/flang/Optimizer/Dialect/CUF/CUFOps.td
+++ b/flang/include/flang/Optimizer/Dialect/CUF/CUFOps.td
@@ -54,7 +54,11 @@ def cuf_AllocOp : cuf_Op<"alloc", [AttrSizedOperandSegments]> {
let assemblyFormat = [{
$in_type (`(` $typeparams^ `:` type($typeparams) `)`)?
- (`,` $shape^ `:` type($shape) )? attr-dict `->` qualified(type($ptr))
+ (`,` $shape^ `:` type($shape) )?
+ (`uniq_name` `(` $uniq_name^ `)`)?
+ (`bindc_name` `(` $bindc_name^ `)`)?
+ `data_attr` `(` qualified($data_attr) `)`
+ attr-dict `->` qualified(type($ptr))
}];
let builders = [
@@ -82,7 +86,8 @@ def cuf_FreeOp : cuf_Op<"free", []> {
cuf_DataAttributeAttr:$data_attr
);
- let assemblyFormat = "$devptr `:` qualified(type($devptr)) attr-dict";
+ let assemblyFormat = "$devptr `:` qualified(type($devptr)) "
+ "`data_attr` `(` qualified($data_attr) `)` attr-dict";
let hasVerifier = 1;
}
@@ -114,6 +119,11 @@ def cuf_AllocateOp : cuf_Op<"allocate", [AttrSizedOperandSegments,
( `errmsg` `(` $errmsg^ `:` type($errmsg) `)` )?
( `stream` `(` $stream^ `:` type($stream) `)` )?
( `pinned` `(` $pinned^ `:` type($pinned) `)` )?
+ (`data_attr` `(` qualified($data_attr)^ `)`)?
+ (`hasStat` $hasStat^)?
+ (`hasDoubleDescriptor` $hasDoubleDescriptor^)?
+ (`pointer` $pointer^)?
+ (`device_source` $device_source^)?
attr-dict `->` type($stat)
}];
@@ -139,6 +149,10 @@ def cuf_DeallocateOp : cuf_Op<"deallocate",
let assemblyFormat = [{
$box `:` qualified(type($box))
( `errmsg` `(` $errmsg^ `:` type($errmsg) `)` )?
+ `data_attr` `(` qualified($data_attr) `)`
+ (`hasStat` $hasStat^)?
+ (`hasDoubleDescriptor` $hasDoubleDescriptor^)?
+ (`pointer` $pointer^)?
attr-dict `->` type($stat)
}];
@@ -183,7 +197,10 @@ def cuf_DataTransferOp : cuf_Op<"data_transfer", []> {
UnitAttr:$hasManagedOrUnifedSymbols);
let assemblyFormat = [{
- $src `to` $dst (`,` $shape^ `:` type($shape) )? attr-dict `:` type($src) `,` type($dst)
+ $src `to` $dst (`,` $shape^ `:` type($shape) )?
+ `transfer_kind` `(` $transfer_kind `)`
+ (`hasManagedOrUnifedSymbols` $hasManagedOrUnifedSymbols^)?
+ attr-dict `:` type($src) `,` type($dst)
}];
let hasVerifier = 1;
@@ -213,7 +230,9 @@ def cuf_KernelLaunchOp : cuf_Op<"kernel_launch", [CallOpInterface,
$callee `<` `<` `<` $grid_x `,` $grid_y `,` $grid_z `,`$block_x `,`
$block_y `,` $block_z
( `,` $bytes^ ( `,` $stream^ `:` type($stream) )? )? `>` `>` `>`
- `` `(` $args `)` ( `:` `(` type($args)^ `)` )? attr-dict
+ `` `(` $args `)` ( `:` `(` type($args)^ `)` )?
+ (`arg_attrs` `(` $arg_attrs^ `)`)?
+ (`res_attrs` `(` $res_attrs^ `)`)? attr-dict
}];
let extraClassDeclaration = [{
@@ -277,6 +296,7 @@ def cuf_KernelOp
( `reduce` `(` $reduceOperands^ `:` type($reduceOperands) `:` $reduceAttrs `)` )?
custom<CUFKernelLoopControl>($region, $lowerbound, type($lowerbound),
$upperbound, type($upperbound), $step, type($step))
+ (`n` `(` $n^ `)`)?
attr-dict
}];
@@ -351,7 +371,8 @@ def cuf_RegisterVariableStaticOp : cuf_Op<"register_variable_static", []> {
);
let assemblyFormat = [{
- $global `(` $varName `,` $size `)` attr-dict
+ $global `(` $varName `,` $size `)`
+ (`deviceResident` $deviceResident^)? attr-dict
}];
}
@@ -386,7 +407,11 @@ def cuf_SharedMemoryOp
let assemblyFormat = [{
(`[` $offset^ `:` type($offset) `]`)? $in_type (`(` $typeparams^ `:` type($typeparams) `)`)?
- (`,` $shape^ `:` type($shape) )? (`align` $alignment^ )? attr-dict `->` qualified(type($ptr))
+ (`,` $shape^ `:` type($shape) )? (`align` $alignment^ )?
+ (`uniq_name` `(` $uniq_name^ `)`)?
+ (`bindc_name` `(` $bindc_name^ `)`)?
+ (`static` $isStatic^)?
+ attr-dict `->` qualified(type($ptr))
}];
let builders = [OpBuilder<(ins "mlir::Type":$inType,
diff --git a/flang/include/flang/Optimizer/Dialect/FIRCG/CGOps.td b/flang/include/flang/Optimizer/Dialect/FIRCG/CGOps.td
index 5a7c85e7883fa3..5422fb1a45cffd 100644
--- a/flang/include/flang/Optimizer/Dialect/FIRCG/CGOps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIRCG/CGOps.td
@@ -22,6 +22,7 @@ include "mlir/IR/BuiltinAttributes.td"
def fircg_Dialect : Dialect {
let name = "fircg";
+ let useStrictPropertiesInAssemblyFormat = 1;
let cppNamespace = "::fir::cg";
}
@@ -67,7 +68,9 @@ def fircg_XEmboxOp : fircg_Op<"ext_embox", [AttrSizedOperandSegments]> {
let assemblyFormat = [{
$memref (`(`$shape^`)`)? (`origin` $shift^)? (`[`$slice^`]`)?
(`path` $subcomponent^)? (`substr` $substr^)? (`typeparams` $lenParams^)?
- (`source_box` $sourceBox^)? attr-dict `:` functional-type(operands, results)
+ (`source_box` $sourceBox^)?
+ (`allocator_idx` `(` $allocator_idx^ `)`)?
+ attr-dict `:` functional-type(operands, results)
}];
let extraClassDeclaration = [{
@@ -245,6 +248,8 @@ def fircg_XDeclareOp : fircg_Op<"ext_declare", [AttrSizedOperandSegments]> {
$memref (`(` $shape^ `)`)? (`origin` $shift^)? (`typeparams` $typeparams^)?
(`dummy_scope` $dummy_scope^ (`arg` $dummy_arg_no^)?)?
(`storage` `(` $storage^ `[` $storage_offset `]` `)`)?
+ `uniq_name` `(` $uniq_name `)`
+ (`data_attr` `(` qualified($data_attr)^ `)`)?
attr-dict `:` functional-type(operands, results)
}];
diff --git a/flang/include/flang/Optimizer/Dialect/FIRDialect.td b/flang/include/flang/Optimizer/Dialect/FIRDialect.td
index 415bf7a6a95fec..65857997f57de9 100644
--- a/flang/include/flang/Optimizer/Dialect/FIRDialect.td
+++ b/flang/include/flang/Optimizer/Dialect/FIRDialect.td
@@ -23,6 +23,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
def FIROpsDialect : Dialect {
let name = "fir";
+ let useStrictPropertiesInAssemblyFormat = 1;
let cppNamespace = "::fir";
let useDefaultTypePrinterParser = 0;
let useDefaultAttributePrinterParser = 0;
diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td
index 1af68c4d846f56..3fc5f31901248f 100644
--- a/flang/include/flang/Optimizer/Dialect/FIROps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -935,7 +935,8 @@ def fir_EmboxOp : fir_Op<"embox", [NoMemoryEffect, AttrSizedOperandSegments,
let assemblyFormat = [{
$memref (`(` $shape^ `)`)? (`[` $slice^ `]`)? (`typeparams` $typeparams^)?
(`source_box` $sourceBox^)? (`map` $accessMap^)?
- (`optional` $optional^)? attr-dict `:`
+ (`optional` $optional^)?
+ (`allocator_idx` `(` $allocator_idx^ `)`)? attr-dict `:`
functional-type(operands, results)
}];
@@ -2467,7 +2468,7 @@ def fir_DispatchOp : fir_Op<"dispatch", []> {
%r = fir.dispatch "methodA"(%o) : (!fir.class<T>) -> i32
// fir.dispatch with the `pass_arg_pos` attribute.
- %r = fir.dispatch "methodA"(%o : !fir.class<T>) (%o : !fir.class<T>) -> i32 {pass_arg_pos = 0 : i32}
+ %r = fir.dispatch "methodA"(%o : !fir.class<T>) (%o : !fir.class<T>) -> i32 pass_arg_pos(0)
```
}];
@@ -2488,7 +2489,11 @@ def fir_DispatchOp : fir_Op<"dispatch", []> {
let assemblyFormat = [{
$method `(` $object `:` qualified(type($object)) `)`
( `(` $args^ `:` type($args) `)` )? (`->` type($results)^)?
- (`proc_attrs` $procedure_attrs^)? attr-dict
+ (`proc_attrs` $procedure_attrs^)?
+ (`pass_arg_pos` `(` $pass_arg_pos^ `)`)?
+ (`arg_attrs` `(` $arg_attrs^ `)`)?
+ (`res_attrs` `(` $res_attrs^ `)`)?
+ attr-dict
}];
let extraClassDeclaration = [{
@@ -2582,7 +2587,9 @@ class ComplexArithmeticOp<string mnemonic, list<Trait> traits = []> :
fir_ArithmeticOp<mnemonic, traits>,
Arguments<(ins AnyFirComplex:$lhs, AnyFirComplex:$rhs,
DefaultValuedAttr<Arith_FastMathAttr,
- "::mlir::arith::FastMathFlags::none">:$fastmath)>;
+ "::mlir::arith::FastMathFlags::none">:$fastmath)> {
+ let assemblyFormat = "operands (`fastmath` `(` $fastmath^ `)`)? attr-dict `:` type($result)";
+}
def fir_AddcOp : ComplexArithmeticOp<"addc",
[Commutative, DeclareOpInterfaceMethods<ArithFastMathInterface>]>;
@@ -3343,7 +3350,7 @@ def fir_DeclareOp
%c20 = arith.constant 20 : index
%1 = fir.load %ag1 : fir.ref<i64>
%2 = fir.shift %c10, %c20 : (index, index) -> !fir.shift<2>
- %3 = fir.declare %arg0(%2) typeparams %1 {fortran_attrs = #fir.var_attrs<optional, target>, uniq_name = "c"}
+ %3 = fir.declare %arg0(%2) typeparams %1 uniq_name("c") fortran_attrs(#fir.var_attrs<optional, target>)
// ... uses %3 as "c"
}
```
@@ -3366,6 +3373,9 @@ def fir_DeclareOp
$memref (`(` $shape^ `)`)? (`typeparams` $typeparams^)?
(`dummy_scope` $dummy_scope^ (`arg` $dummy_arg_no^)?)?
(`storage` `(` $storage^ `[` $storage_offset `]` `)`)?
+ `uniq_name` `(` $uniq_name `)`
+ (`fortran_attrs` `(` $fortran_attrs^ `)`)?
+ (`data_attr` `(` qualified($data_attr)^ `)`)?
attr-dict `:` functional-type(operands, results)
}];
@@ -3408,6 +3418,9 @@ def fir_DeclareValueOp
let assemblyFormat = [{
$value
(`dummy_scope` $dummy_scope^ (`arg` $dummy_arg_no^)?)?
+ `uniq_name` `(` $uniq_name `)`
+ (`fortran_attrs` `(` $fortran_attrs^ `)`)?
+ (`data_attr` `(` qualified($data_attr)^ `)`)?
attr-dict `:` type($value)
}];
@@ -3490,14 +3503,14 @@ def fir_DummyScopeOp : fir_Op<"dummy_scope",
func.func @_QPtest(
%arg0: !fir.ref<f32> {fir.target},
%arg1: !fir.ref<f32> {fir.target}) {
- %0 = fir.declare %arg0 {fortran_attrs = #fir.var_attrs<target>} :
+ %0 = fir.declare %arg0 uniq_name("x") fortran_attrs(#fir.var_attrs<target>) :
(!fir.ref<f32>) -> !fir.ref<f32>
- %1 = fir.declare %arg1 {fortran_attrs = #fir.var_attrs<target>} :
+ %1 = fir.declare %arg1 uniq_name("y") fortran_attrs(#fir.var_attrs<target>) :
(!fir.ref<f32>) -> !fir.ref<f32>
%2 = fir.load %1 : !fir.ref<f32>
fir.store %2 to %0 : !fir.ref<f32>
- %3 = fir.declare %0 : (!fir.ref<f32>) -> !fir.ref<f32>
- %4 = fir.declare %1 : (!fir.ref<f32>) -> !fir.ref<f32>
+ %3 = fir.declare %0 uniq_name("x") : (!fir.ref<f32>) -> !fir.ref<f32>
+ %4 = fir.declare %1 uniq_name("y") : (!fir.ref<f32>) -> !fir.ref<f32>
%5 = fir.load %4 : !fir.ref<f32>
fir.store %5 to %3 : !fir.ref<f32>
return
@@ -3512,17 +3525,17 @@ def fir_DummyScopeOp : fir_Op<"dummy_scope",
%arg0: !fir.ref<f32> {fir.target},
%arg1: !fir.ref<f32> {fir.target}) {
%h1 = fir.dummy_scope : i1
- %0 = fir.declare %arg0 dummy_scope(%h1)
- {fortran_attrs = #fir.var_attrs<target>} :
+ %0 = fir.declare %arg0 dummy_scope %h1
+ uniq_name("x") fortran_attrs(#fir.var_attrs<target>) :
(!fir.ref<f32>) -> !fir.ref<f32>
- %1 = fir.declare %arg1 dummy_scope(%h1)
- {fortran_attrs = #fir.var_attrs<target>} :
+ %1 = fir.declare %arg1 dummy_scope %h1
+ uniq_name("y") fortran_attrs(#fir.var_attrs<target>) :
(!fir.ref<f32>) -> !fir.ref<f32>
%2 = fir.load %1 : !fir.ref<f32>
fir.store %2 to %0 : !fir.ref<f32>
%h2 = fir.dummy_scope : i1
- %3 = fir.declare %0 dummy_scope(%h2) : (!fir.ref<f32>) -> !fir.ref<f32>
- %4 = fir.declare %1 dummy_scope(%h2) : (!fir.ref<f32>) -> !fir.ref<f32>
+ %3 = fir.declare %0 dummy_scope %h2 uniq_name("x") : (!fir.ref<f32>) -> !fir.ref<f32>
+ %4 = fir.declare %1 dummy_scope %h2 uniq_name("y") : (!fir.ref<f32>) -> !fir.ref<f32>
%5 = fir.load %4 : !fir.ref<f32>
fir.store %5 to %3 : !fir.ref<f32>
return
@@ -3898,6 +3911,7 @@ def fir_DeclareReductionOp : fir_Op<"declare_reduction", [IsolatedFromAbove,
AnyRegion:$dataPtrPtrRegion);
let assemblyFormat = "($sym_visibility^)? $sym_name `:` $type "
+ "(`byref_element_type` `(` $byref_element_type^ `)`)? "
"attr-dict-with-keyword "
"( `alloc` $allocRegion^ )? "
"`init` $initializerRegion "
diff --git a/flang/include/flang/Optimizer/Dialect/MIF/MIFDialect.td b/flang/include/flang/Optimizer/Dialect/MIF/MIFDialect.td
index f8be6a86a79fec..da7c9e48d3289f 100644
--- a/flang/include/flang/Optimizer/Dialect/MIF/MIFDialect.td
+++ b/flang/include/flang/Optimizer/Dialect/MIF/MIFDialect.td
@@ -20,6 +20,7 @@ include "mlir/IR/OpBase.td"
def MIFDialect : Dialect {
let name = "mif";
+ let useStrictPropertiesInAssemblyFormat = 1;
let summary = "Multi-Image Fortran dialect";
diff --git a/flang/include/flang/Optimizer/Dialect/MIF/MIFOps.td b/flang/include/flang/Optimizer/Dialect/MIF/MIFOps.td
index cdc81ab1b97648..5cf3e19549b70d 100644
--- a/flang/include/flang/Optimizer/Dialect/MIF/MIFOps.td
+++ b/flang/include/flang/Optimizer/Dialect/MIF/MIFOps.td
@@ -571,6 +571,7 @@ def mif_AllocCoarrayOp
`lcobounds` $lcobounds `ucobounds` $ucobounds
(`stat` $stat^ )?
(`errmsg` $errmsg^ )?
+ `uniq_name` `(` $uniq_name `)`
attr-dict `:` functional-type(operands, results)
}];
}
diff --git a/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td b/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
index 1f46b69561d68c..b13585d349eb15 100644
--- a/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
+++ b/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
@@ -21,6 +21,7 @@ include "flang/Optimizer/Dialect/FIRTypes.td"
def hlfir_Dialect : Dialect {
let name = "hlfir";
+ let useStrictPropertiesInAssemblyFormat = 1;
let summary = "High Level Fortran IR.";
diff --git a/flang/include/flang/Optimizer/HLFIR/HLFIROps.td b/flang/include/flang/Optimizer/HLFIR/HLFIROps.td
index 5e09fe31a91eb3..d8116eb0f1f008 100644
--- a/flang/include/flang/Optimizer/HLFIR/HLFIROps.td
+++ b/flang/include/flang/Optimizer/HLFIR/HLFIROps.td
@@ -89,7 +89,7 @@ def hlfir_DeclareOp
%c20 = arith.constant 20 : index
%1 = fir.load %ag1 : fir.ref<i64>
%2 = fir.shape_shift %c10, %1, %c20, %1 : (index, index, index, index) -> !fir.shapeshift<2>
- %3 = hfir.declare %arg0(%2) typeparams %1 {uniq_name = "c"} (fir.ref<!fir.array<?x?x!fir.char<1,?>>>, fir.shapeshift<2>, index) -> (fir.box<!fir.array<?x?x!fir.char<1,?>>>, fir.ref<!fir.array<?x?x!fir.char<1,?>>>)
+ %3 = hlfir.declare %arg0(%2) typeparams %1 uniq_name("c") (fir.ref<!fir.array<?x?x!fir.char<1,?>>>, fir.shapeshift<2>, index) -> (fir.box<!fir.array<?x?x!fir.char<1,?>>>, fir.ref<!fir.array<?x?x!fir.char<1,?>>>)
// ... uses %3#0 as "c"
}
```
@@ -113,6 +113,9 @@ def hlfir_DeclareOp
(`dummy_scope` $dummy_scope^ (`arg` $dummy_arg_no^)?)?
(`storage` `(` $storage^ `[` $storage_offset `]` `)`)?
(`skip_rebox` $skip_rebox^)?
+ `uniq_name` `(` $uniq_name `)`
+ (`fortran_attrs` `(` $fortran_attrs^ `)`)?
+ (`data_attr` `(` qualified($data_attr)^ `)`)?
attr-dict `:` functional-type(operands, results)
}];
@@ -277,6 +280,7 @@ def hlfir_DesignateOp
(`substr` $substring^)?
custom<DesignatorComplexPart>($complex_part)
(`shape` $shape^)? (`typeparams` $typeparams^)?
+ (`fortran_attrs` `(` $fortran_attrs^ `)`)?
attr-dict `:` functional-type(operands, results)
}];
@@ -519,7 +523,7 @@ def hlfir_MaxvalOp : hlfir_Op<"maxval", [AttrSizedOperandSegments,
let results = (outs AnyFortranValue);
let assemblyFormat = [{
- $array (`dim` $dim^)? (`mask` $mask^)? attr-dict `:` functional-type(operands, results)
+ $array (`dim` $dim^)? (`mask` $mask^)? (`fastmath` `(` $fastmath^ `)`)? attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -546,7 +550,7 @@ def hlfir_MinvalOp : hlfir_Op<"minval", [AttrSizedOperandSegments,
let results = (outs AnyFortranValue);
let assemblyFormat = [{
- $array (`dim` $dim^)? (`mask` $mask^)? attr-dict `:` functional-type(operands, results)
+ $array (`dim` $dim^)? (`mask` $mask^)? (`fastmath` `(` $fastmath^ `)`)? attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -572,7 +576,7 @@ def hlfir_MinlocOp : hlfir_Op<"minloc", [AttrSizedOperandSegments,
let results = (outs AnyFortranValue);
let assemblyFormat = [{
- $array (`dim` $dim^)? (`mask` $mask^)? (`back` $back^)? attr-dict `:` functional-type(operands, results)
+ $array (`dim` $dim^)? (`mask` $mask^)? (`back` $back^)? (`fastmath` `(` $fastmath^ `)`)? attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -598,7 +602,7 @@ def hlfir_MaxlocOp : hlfir_Op<"maxloc", [AttrSizedOperandSegments,
let results = (outs AnyFortranValue);
let assemblyFormat = [{
- $array (`dim` $dim^)? (`mask` $mask^)? (`back` $back^)? attr-dict `:` functional-type(operands, results)
+ $array (`dim` $dim^)? (`mask` $mask^)? (`back` $back^)? (`fastmath` `(` $fastmath^ `)`)? attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -624,7 +628,7 @@ def hlfir_ProductOp : hlfir_Op<"product", [AttrSizedOperandSegments,
let results = (outs AnyFortranValue);
let assemblyFormat = [{
- $array (`dim` $dim^)? (`mask` $mask^)? attr-dict `:` functional-type(operands, results)
+ $array (`dim` $dim^)? (`mask` $mask^)? (`fastmath` `(` $fastmath^ `)`)? attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -689,7 +693,7 @@ def hlfir_SumOp : hlfir_Op<"sum", [AttrSizedOperandSegments,
let results = (outs AnyFortranValue);
let assemblyFormat = [{
- $array (`dim` $dim^)? (`mask` $mask^)? attr-dict `:` functional-type(operands, results)
+ $array (`dim` $dim^)? (`mask` $mask^)? (`fastmath` `(` $fastmath^ `)`)? attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -713,7 +717,8 @@ def hlfir_DotProductOp : hlfir_Op<"dot_product",
let results = (outs AnyFortranValue);
let assemblyFormat = [{
- $lhs $rhs attr-dict `:` functional-type(operands, results)
+ $lhs $rhs (`fastmath` `(` $fastmath^ `)`)?
+ attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -737,7 +742,8 @@ def hlfir_MatmulOp : hlfir_Op<"matmul",
let results = (outs hlfir_ExprType);
let assemblyFormat = [{
- $lhs $rhs attr-dict `:` functional-type(operands, results)
+ $lhs $rhs (`fastmath` `(` $fastmath^ `)`)?
+ attr-dict `:` functional-type(operands, results)
}];
// MATMUL(TRANSPOSE(...), ...) => hlfir.matmul_transpose
@@ -782,7 +788,8 @@ def hlfir_MatmulTransposeOp : hlfir_Op<"matmul_transpose",
let results = (outs hlfir_ExprType);
let assemblyFormat = [{
- $lhs $rhs attr-dict `:` functional-type(operands, results)
+ $lhs $rhs (`fastmath` `(` $fastmath^ `)`)?
+ attr-dict `:` functional-type(operands, results)
}];
let hasVerifier = 1;
@@ -890,6 +897,8 @@ def hlfir_AssociateOp : hlfir_Op<"associate", [AttrSizedOperandSegments,
let assemblyFormat = [{
$source (`(` $shape^ `)`)? (`typeparams` $typeparams^)?
+ (`uniq_name` `(` $uniq_name^ `)`)?
+ (`fortran_attrs` `(` $fortran_attrs^ `)`)?
attr-dict `:` functional-type(operands, results)
}];
@@ -1379,7 +1388,7 @@ def hlfir_GetExtentOp : hlfir_Op<"get_extent", [Pure]> {
let hasVerifier = 1;
let assemblyFormat = [{
- $shape attr-dict `:` functional-type(operands, results)
+ $shape `dim` `(` $dim `)` attr-dict `:` functional-type(operands, results)
}];
let builders = [OpBuilder<(ins "mlir::Value":$shape, "unsigned":$dim)>];
diff --git a/flang/test/Analysis/AliasAnaly...
[truncated]
|
b8796ff to
cd0392e
Compare
e407dce to
76e3e37
Compare
|
LGTM. I'll just check downstream what are the implication so we are ready when you merge. |
There was a problem hiding this comment.
LGTM
Edit: please still wait for @clementval feedback on testing the patch.
clementval
left a comment
There was a problem hiding this comment.
LGTM. I have prepared our downstream patches for when this lands.
|
Thanks! Note though that upstream development isn't really supposed to be paced by specific downstream constraints. |
Enable strict properties in FIR, HLFIR, CUF, MIF, and FIRCG. Bind inherent attributes explicitly in custom formats and update Flang assembly checks. Assisted-by: Codex
76e3e37 to
81ba177
Compare
…m#226602) Enable strict properties in FIR, HLFIR, CUF, MIF, and FIRCG. Bind inherent attributes explicitly in custom formats and update Flang assembly checks. Assisted-by: Codex
llvm#226602 Change the assembly format for the flang dialects. These tests were likely newer than the last rebase of the PR and need some updates.
…6602) Enable strict properties in FIR, HLFIR, CUF, MIF, and FIRCG. Bind inherent attributes explicitly in custom formats and update Flang assembly checks. Assisted-by: Codex
Enable strict properties in FIR, HLFIR, CUF, MIF, and FIRCG. Bind inherent attributes explicitly in custom formats and update Flang assembly checks.
Assisted-by: Codex