Skip to content

Commit c226d6c

Browse files
committed
[Documentation][NFC] Remove invalid language specifiers in markdown code blocks
1 parent 2bed2a7 commit c226d6c

File tree

6 files changed

+128
-128
lines changed

6 files changed

+128
-128
lines changed

flang/docs/ComplexOperations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ end function pow_self
3535
```
3636

3737
**FIR**
38-
```c
38+
```
3939
func.func @_QPpow_self(%arg0: !fir.ref<!fir.complex<4>>) -> !fir.complex<4> {
4040
%0 = fir.alloca !fir.complex<4>
4141
%1 = fir.load %arg0 : !fir.ref<!fir.complex<4>>

flang/docs/FIRArrayOperations.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!--===- docs/FIRArrayOperations.md
2-
1+
<!--===- docs/FIRArrayOperations.md
2+
33
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
See https://llvm.org/LICENSE.txt for license information.
55
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6-
6+
77
-->
88

99
# Design: FIR Array operations
@@ -19,7 +19,7 @@ local:
1919
The array operations in FIR model the copy-in/copy-out semantics over Fortran
2020
statements.
2121

22-
Fortran language semantics sometimes require the compiler to make a temporary
22+
Fortran language semantics sometimes require the compiler to make a temporary
2323
copy of an array or array slice. Situations where this can occur include:
2424

2525
* Passing a non-contiguous array to a procedure that does not declare it as
@@ -40,7 +40,7 @@ There are currently the following operations:
4040
`array_load`(s) and `array_merge_store` are a pairing that brackets the lifetime
4141
of the array copies.
4242

43-
`array_fetch` and `array_update` are defined to work as getter/setter pairs on
43+
`array_fetch` and `array_update` are defined to work as getter/setter pairs on
4444
values of elements from loaded array copies. These have "GEP-like" syntax and
4545
semantics.
4646

@@ -83,7 +83,7 @@ alter its composite value. This operation lets one load an array as a
8383
value while applying a runtime shape, shift, or slice to the memory
8484
reference, and its semantics guarantee immutability.
8585

86-
```mlir
86+
```
8787
%s = fir.shape_shift %lb1, %ex1, %lb2, %ex2 : (index, index, index, index) -> !fir.shapeshift<2>
8888
// load the entire array 'a'
8989
%v = fir.array_load %a(%s) : (!fir.ref<!fir.array<?x?xf32>>, !fir.shapeshift<2>) -> !fir.array<?x?xf32>
@@ -92,7 +92,7 @@ reference, and its semantics guarantee immutability.
9292

9393
# array_merge_store
9494

95-
The `array_merge_store` operation stores a merged array value to memory.
95+
The `array_merge_store` operation stores a merged array value to memory.
9696

9797

9898
```fortran
@@ -104,7 +104,7 @@ The `array_merge_store` operation stores a merged array value to memory.
104104
One can use `fir.array_merge_store` to merge/copy the value of `a` in an
105105
array expression as shown above.
106106

107-
```mlir
107+
```
108108
%v = fir.array_load %a(%shape) : ...
109109
%r = fir.array_update %v, %f, %i, %j : (!fir.array<?x?xf32>, f32, index, index) -> !fir.array<?x?xf32>
110110
fir.array_merge_store %v, %r to %a : !fir.ref<!fir.array<?x?xf32>>
@@ -137,7 +137,7 @@ One can use `fir.array_fetch` to fetch the (implied) value of `a(i,j)` in
137137
an array expression as shown above. It can also be used to extract the
138138
element `a(r,s+1)` in the second expression.
139139

140-
```mlir
140+
```
141141
%s = fir.shape %n, %m : (index, index) -> !fir.shape<2>
142142
// load the entire array 'a'
143143
%v = fir.array_load %a(%s) : (!fir.ref<!fir.array<?x?xf32>>, !fir.shape<2>) -> !fir.array<?x?xf32>
@@ -165,7 +165,7 @@ the update.
165165
One can use `fir.array_update` to update the (implied) value of `a(i,j)`
166166
in an array expression as shown above.
167167

168-
```mlir
168+
```
169169
%s = fir.shape %n, %m : (index, index) -> !fir.shape<2>
170170
// load the entire array 'a'
171171
%v = fir.array_load %a(%s) : (!fir.ref<!fir.array<?x?xf32>>, !fir.shape<2>) -> !fir.array<?x?xf32>
@@ -206,7 +206,7 @@ the element `a(i,j)` in an array expression `a` as shown above. It can also
206206
be used to recover the reference element `a(r,s+1)` in the second
207207
expression.
208208

209-
```mlir
209+
```
210210
%s = fir.shape %n, %m : (index, index) -> !fir.shape<2>
211211
// load the entire array 'a'
212212
%v = fir.array_load %a(%s) : (!fir.ref<!fir.array<?x?xf32>>, !fir.shape<2>) -> !fir.array<?x?xf32>
@@ -220,9 +220,9 @@ source. Other array operation such as `array_amend` can be in between.
220220

221221
`array_access` if mainly used with `character`'s arrays and arrays of derived
222222
types where because they might have a non-compile time sizes that would be
223-
useless too load entirely or too big to load.
223+
useless too load entirely or too big to load.
224224

225-
Here is a simple example with a `character` array assignment.
225+
Here is a simple example with a `character` array assignment.
226226

227227
Fortran
228228
```
@@ -271,12 +271,12 @@ it has dynamic length, and even if constant, could be too long to do so.
271271

272272
## array_amend
273273

274-
The `array_amend` operation marks an array value as having been changed via a
274+
The `array_amend` operation marks an array value as having been changed via a
275275
reference obtain by an `array_access`. It acts as a logical transaction log
276276
that is used to merge the final result back with an `array_merge_store`
277277
operation.
278278

279-
```mlir
279+
```
280280
// fetch the value of one of the array value's elements
281281
%1 = fir.array_access %v, %i, %j : (!fir.array<?x?xT>, index, index) -> !fir.ref<T>
282282
// modify the element by storing data using %1 as a reference
@@ -317,7 +317,7 @@ func @_QPs(%arg0: !fir.box<!fir.array<?x!fir.type<_QFsTt{m:i32}>>>, %arg1: !fir.
317317
// This is the "seed" for the "copy-out" array on the LHS. It'll flow from iteration to iteration and gets
318318
// updated at each iteration.
319319
%array_a_dest_init = fir.array_load %arg0 : (!fir.box<!fir.array<?x!fir.type<_QFsTt{m:i32}>>>) -> !fir.array<?x!fir.type<_QFsTt{m:i32}>>
320-
320+
321321
%array_a_final = fir.do_loop %i = %l_index to %u_index step %c1 unordered iter_args(%array_a_dest = %array_a_dest_init) -> (!fir.array<?x!fir.type<_QFsTt{m:i32}>>) {
322322
// Compute indexing for the RHS and array the element.
323323
%u_minus_i = arith.subi %u_index, %i : index // u-i

flang/docs/HighLevelFIR.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ its first operand to return an HLFIR variable compatible type.
119119
The fir.declare op is the only operation described by this change that will be
120120
added to FIR. The rational for this is that it is intended to survive until
121121
LLVM dialect codegeneration so that debug info generation can use them and
122-
alias information can take advantage of them even on FIR.
122+
alias information can take advantage of them even on FIR.
123123

124124
Note that Fortran variables are not necessarily named objects, they can also be
125125
the result of function references returning POINTERs. hlfir.declare will also
@@ -1021,7 +1021,7 @@ end subroutine
10211021

10221022
Lowering output:
10231023

1024-
```HLFIR
1024+
```
10251025
func.func @_QPfoo(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: !fir.box<!fir.array<?xf32>>) {
10261026
%a = hlfir.declare %arg0 {fir.def = "_QPfooEa"} : !fir.box<!fir.array<?xf32>>, !fir.box<!fir.array<?xf32>>
10271027
%b = hlfir.declare %arg1 {fir.def = "_QPfooEb"} : !fir.box<!fir.array<?xf32>>, !fir.box<!fir.array<?xf32>>
@@ -1107,7 +1107,7 @@ end subroutine
11071107

11081108
Lowering output:
11091109

1110-
```HLFIR
1110+
```
11111111
func.func @_QPfoo(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: !fir.box<!fir.array<?xf32>>, %arg2: !fir.box<!fir.ptr<!fir.array<?xf32>>>, %arg3: !fir.ref<!fir.array<100xf32>>) {
11121112
%a = hlfir.declare %arg0 {fir.def = "_QPfooEa"} {fir.target} : !fir.box<!fir.array<?xf32>, !fir.box<!fir.array<?xf32>
11131113
%b = hlfir.declare %arg1 {fir.def = "_QPfooEb"} : !fir.box<!fir.array<?xf32>>, !fir.box<!fir.array<?xf32>>
@@ -1145,7 +1145,7 @@ Step 1: hlfir.elemental inlining: inline the first hlfir.elemental into the
11451145
second one at the hlfir.apply.
11461146

11471147

1148-
```HLFIR
1148+
```
11491149
func.func @_QPfoo(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: !fir.box<!fir.array<?xf32>>, %arg2: !fir.box<!fir.ptr<!fir.array<?xf32>>>, %arg3: !fir.ref<!fir.array<100xf32>>) {
11501150
%a = hlfir.declare %arg0 {fir.def = "_QPfooEa"} {fir.target} : !fir.box<!fir.array<?xf32>, !fir.box<!fir.array<?xf32>
11511151
%b = hlfir.declare %arg1 {fir.def = "_QPfooEb"} : !fir.box<!fir.array<?xf32>>, !fir.box<!fir.array<?xf32>>
@@ -1190,7 +1190,7 @@ Note that the alias analysis could have already occurred without inlining the
11901190
%add hlfir.elemental.
11911191

11921192

1193-
```HLFIR
1193+
```
11941194
func.func @_QPfoo(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: !fir.box<!fir.array<?xf32>>, %arg2: !fir.box<!fir.ptr<!fir.array<?xf32>>>, %arg3: !fir.ref<!fir.array<100xf32>>) {
11951195
%a = hlfir.declare %arg0 {fir.def = "_QPfooEa"} {fir.target} : !fir.box<!fir.array<?xf32>, !fir.box<!fir.array<?xf32>
11961196
%b = hlfir.declare %arg1 {fir.def = "_QPfooEb"} : !fir.box<!fir.array<?xf32>>, !fir.box<!fir.array<?xf32>>
@@ -1229,7 +1229,7 @@ func.func @_QPfoo(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: !fir.box<!fir.array
12291229
Step 4: Lower assignments to regular loops since they have the no_overlap
12301230
attribute, and inline the hlfir.elemental into the first loop nest.
12311231

1232-
```HLFIR
1232+
```
12331233
func.func @_QPfoo(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: !fir.box<!fir.array<?xf32>>, %arg2: !fir.box<!fir.ptr<!fir.array<?xf32>>>, %arg3: !fir.ref<!fir.array<100xf32>>) {
12341234
%a = hlfir.declare %arg0 {fir.def = "_QPfooEa"} {fir.target} : !fir.box<!fir.array<?xf32>, !fir.box<!fir.array<?xf32>
12351235
%b = hlfir.declare %arg1 {fir.def = "_QPfooEb"} : !fir.box<!fir.array<?xf32>>, !fir.box<!fir.array<?xf32>>
@@ -1275,7 +1275,7 @@ Step 5 (may also occur earlier or several times): shape propagation.
12751275
conformance checks can be added for %a, %b and %p.
12761276
- %temp is small, and its fir.allocmem can be promoted to a stack allocation
12771277

1278-
```HLFIR
1278+
```
12791279
func.func @_QPfoo(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: !fir.box<!fir.array<?xf32>>, %arg2: !fir.box<!fir.ptr<!fir.array<?xf32>>>, %arg3: !fir.ref<!fir.array<100xf32>>) {
12801280
// .....
12811281
%cshape = fir.shape %c100
@@ -1366,7 +1366,7 @@ the MLIR infrastructure experience that was gained.
13661366

13671367
## Using symbols for HLFIR variables
13681368

1369-
### Using attributes as pseudo variable symbols
1369+
### Using attributes as pseudo variable symbols
13701370

13711371
Instead of restricting the memory types an HLFIR variable can have, it was
13721372
force the defining operation of HLFIR variable SSA values to always be

flang/docs/ParameterizedDerivedTypes.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ In case of `len_type1`, the size, offset, etc. of `fld1` and `fld2` depend on
9696
the runtime values of `i` and `j` when the components are inlined into the
9797
derived type. At runtime, this information needs to be computed to be retrieved.
9898
While lowering the PDT, compiler generated functions can be created in order to
99-
compute this information.
99+
compute this information.
100100

101101
Note: The type description tables generated by semantics and used throughout the
102102
runtime have component offsets as constants. Inlining component would require
@@ -127,7 +127,7 @@ type len_type2(i, j)
127127
! allocatable components managed by the compiler. The
128128
! `compiler_managed_allocatable` is not a proper keyword but just added here
129129
! to have a better understanding.
130-
character(i+j), compiler_managed_allocatable :: fld1
130+
character(i+j), compiler_managed_allocatable :: fld1
131131
character(j-i+2), compiler_managed_allocatable :: fld2
132132
end type
133133
```
@@ -266,7 +266,7 @@ the offset of `fld1` in `len_type1` could be 0; its size would be computed as
266266
function.
267267

268268
**FIR**
269-
```c
269+
```
270270
// Example of compiler generated functions to compute offsets, size, etc.
271271
// This is just an example and actual implementation might have more functions.
272272
@@ -337,7 +337,7 @@ pdt_inlined_array(1)%field%fld2
337337
```
338338

339339
Example of offset computation in the PDTs.
340-
```c
340+
```
341341
%0 = call @_len_type3.field.typeparam.1(%i, %j) : (index, index) -> index
342342
%1 = call @_len_type3.field.typeparam.2(%i, %j) : (index, index) -> index
343343
%2 = call @_len_type3.offset.fld(%i, %j) : (index, index) -> index
@@ -367,7 +367,7 @@ operation can take the length type parameters needed for size/offset
367367
computation.
368368

369369
**FIR**
370-
```c
370+
```
371371
%5 = fir.field_index i, !fir.type<_QMmod1Tt{l:i32,i:!fir.array<?xi32>}>(%n : i32)
372372
```
373373

@@ -431,7 +431,7 @@ allocate(t1(2)::p)
431431
```
432432

433433
**FIR**
434-
```c
434+
```
435435
// For allocatable
436436
%5 = fir.call @_FortranAAllocatableInitDerived(%desc, %type) : (!fir.box<none>, ) -> ()
437437
// The AllocatableSetDerivedLength functions is called for each length type parameters.
@@ -455,8 +455,8 @@ The `DEALLOCATE` statement is lowered to a runtime call to
455455
deallocate(pdt1)
456456
```
457457

458-
**FIR**
459-
```c
458+
**FIR**
459+
```
460460
// For allocatable
461461
%8 = fir.call @_FortranAAllocatableDeallocate(%desc1) : (!fir.box<none>) -> (i32)
462462
@@ -475,7 +475,7 @@ NULLIFY(p)
475475
```
476476

477477
**FIR**
478-
```c
478+
```
479479
%0 = fir.call @_FortranAPointerNullifyDerived(%desc, %type) : (!fir.box<none>, !fir.tdesc) -> ()
480480
```
481481

@@ -507,11 +507,11 @@ end subroutine
507507
```
508508

509509
**FIR**
510-
```c
510+
```
511511
func.func @_QMpdtPprint_pdt() {
512512
%l = arith.constant = 10
513513
%0 = fir.alloca !fir.type<_QMpdtTt{l:i32,i:!fir.array<?xi32>}> (%l : i32) {bindc_name = "x", uniq_name = "_QMpdt_initFlocalEx"}
514-
%1 = fir.embox %0 : (!fir.ref<!fir.type<_QMpdtTt{l:i32,i:!fir.array<?xi32>}>>) (typeparams %l : i32) -> !fir.box<!fir.type<_QMpdt_initTt{l:i32,i:!fir.array<2xi32>}>>
514+
%1 = fir.embox %0 : (!fir.ref<!fir.type<_QMpdtTt{l:i32,i:!fir.array<?xi32>}>>) (typeparams %l : i32) -> !fir.box<!fir.type<_QMpdt_initTt{l:i32,i:!fir.array<2xi32>}>>
515515
%2 = fir.address_of(@_QQcl.2E2F6669725F7064745F6578616D706C652E66393000) : !fir.ref<!fir.char<1,22>>
516516
%c8_i32 = arith.constant 8 : i32
517517
%3 = fir.convert %1 : (!fir.box<!fir.type<_QMpdtTt{l:i32,i:!fir.array<?xi32>}>>) -> !fir.box<none>
@@ -564,7 +564,7 @@ type(t(10)) :: a, b
564564
type(t(20)) :: c
565565
type(t(:)), allocatable :: d
566566
a = b ! Legal assignment
567-
c = b ! Illegal assignment because `c` does not have the same length type
567+
c = b ! Illegal assignment because `c` does not have the same length type
568568
! parameter value than `b`.
569569
d = c ! Legal because `d` is allocatable
570570
```
@@ -607,12 +607,12 @@ module m
607607
end type
608608
609609
contains
610-
610+
611611
subroutine finalize_t1s(x)
612612
type(t(kind(0.0))) x
613613
if (associated(x%vector)) deallocate(x%vector)
614614
END subroutine
615-
615+
616616
subroutine finalize_t1v(x)
617617
type(t(kind(0.0))) x(:)
618618
do i = lbound(x,1), ubound(x,1)
@@ -832,7 +832,7 @@ allocating a PDT, the length type parameters are passed to the
832832
operation so its size can be computed accordingly.
833833

834834
**FIR**
835-
```c
835+
```
836836
%i = arith.constant 10 : i32
837837
%0 = fir.alloca !fir.type<_QMmod1Tpdt{i:i32,data:!fir.array<?xf32>}> (%i : i32)
838838
// %i is the ssa value of the length type parameter
@@ -845,7 +845,7 @@ value of the given type. When creating a PDT, the length type parameters are
845845
passed so the size can be computed accordingly.
846846

847847
**FIR**
848-
```c
848+
```
849849
%i = arith.constant 10 : i32
850850
%0 = fir.alloca !fir.type<_QMmod1Tpdt{i:i32,data:!fir.array<?xf32>}> (%i : i32)
851851
// ...
@@ -866,7 +866,7 @@ end subroutine
866866
```
867867

868868
**FIR**
869-
```c
869+
```
870870
func.func @_QMpdt_initPlocal() {
871871
%c2_i32 = arith.constant 2 : i32
872872
%0 = fir.alloca !fir.type<_QMpdt_initTt{l:i32,i:!fir.array<?xi32>}> (%c2 : i32)
@@ -892,7 +892,7 @@ a field identifier in a derived-type. The operation takes length type parameter
892892
values with a PDT so it can compute a correct offset.
893893

894894
**FIR**
895-
```c
895+
```
896896
%l = arith.constant 10 : i32
897897
%1 = fir.field_index i, !fir.type<_QMpdt_initTt{l:i32,i:i32}> (%l : i32)
898898
%2 = fir.coordinate_of %ref, %1 : (!fir.type<_QMpdt_initTt{l:i32,i:i32}>, !fir.field) -> !fir.ref<i32>
@@ -905,7 +905,7 @@ return %3
905905
This operation is used to get the length type parameter offset in from a PDT.
906906

907907
**FIR**
908-
```c
908+
```
909909
func.func @_QPpdt_len_value(%arg0: !fir.box<!fir.type<t1{l:i32,!fir.array<?xi32>}>>) -> i32 {
910910
%0 = fir.len_param_index l, !fir.box<!fir.type<t1{l:i32,!fir.array<?xi32>}>>
911911
%1 = fir.coordinate_of %arg0, %0 : (!fir.box<!fir.type<t1{l:i32,!fir.array<?xi32>}>>, !fir.len) -> !fir.ref<i32>
@@ -921,7 +921,7 @@ a memory location given the shape and LEN parameters of the result. Length type
921921
parameters is passed if the PDT is not boxed.
922922

923923
**FIR**
924-
```c
924+
```
925925
func.func @return_pdt(%buffer: !fir.ref<!fir.type<t2(l1:i32,l2:i32){x:f32}>>) {
926926
%l1 = arith.constant 3 : i32
927927
%l2 = arith.constant 5 : i32
@@ -938,7 +938,7 @@ parameters operands. This is designed to use PDT without descriptor directly in
938938
FIR.
939939

940940
**FIR**
941-
```c
941+
```
942942
// Operation used with a boxed PDT does not need the length type parameters as
943943
// they are directly retrieved from the box.
944944
%0 = fir.array_coor %boxed_pdt, %i, %j (fir.box<fir.array<?x?xfir.type<!fir.type<_QMpdt_initTt{l:i32,i:!fir.array<?xi32>}>>>>, index, index) -> !fir.ref<fir.type<!fir.type<_QMpdt_initTt{l:i32,i:!fir.array<?xi32>}>>>

0 commit comments

Comments
 (0)