[flang-commits] [flang] [flang] Apply nocapture attribute to dummy arguments (PR #116182)

via flang-commits flang-commits at lists.llvm.org
Fri Nov 15 05:10:44 PST 2024


https://github.com/jeanPerier commented:

The change in the pass looks good to me, but you should probably enable this pass by default (or at least when O > O0, opinions welcomed here) because it is currently only run under a specific set of conditions (see https://github.com/llvm/llvm-project/blob/40afff7bd95090a75bc68a0d26b8017cc0ae65c1/flang/lib/Optimizer/Passes/Pipelines.cpp#L278).

Currently, if one run the patch with `flang -fc1 -emit-llvm -O2` on the code below the pass is not run and the attribute not added.
 
```
subroutine foo(x)
  call bar(x)
end subroutine
```

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


More information about the flang-commits mailing list