[flang-commits] [flang] [flang] Implement !DIR$ VECTOR ALWAYS (PR #93830)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Tue Jun 11 12:19:40 PDT 2024


================
@@ -36,3 +36,46 @@ A list of non-standard directives supported by Flang
   and is limited to 256.
   [This directive is currently recognised by the parser, but not
   handled by the other parts of the compiler].
+* `!dir$ vector always` forces vectorization on the following loop regardless
+  of cost model decisions. The loop must still be vectorizable.
+  [This directive currently only works on plain do loops without labels].
+
+# Directive Details
+
+## Introduction
+Directives are commonly used in Fortran programs to specify additional actions 
+to be performed by the compiler. The directives are always specified with the 
+`!dir$` or `cdir$` prefix. 
+
+## Loop Directives
+Some directives are associated with the following construct, for example loop
+directives. Directives on loops are used to specify additional transformation to
+be performed by the compiler like enabling vectorisation, unrolling, interchange
+etc.
+
+### Array Expressions
+It is to be decided whether loop directives should also be able to be associated
+with array expressions.
+
+## Semantics
+Dirctives that are associated with constructs must appear in the same section as
----------------
kiranchandramohan wrote:

```suggestion
Directives that are associated with constructs must appear in the same section as
```

https://github.com/llvm/llvm-project/pull/93830


More information about the flang-commits mailing list