[flang-commits] [flang] [flang] add tbaa tags to global variables (PR #68727)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Wed Oct 11 09:07:04 PDT 2023


================
@@ -406,7 +406,7 @@ AliasAnalysis::Source AliasAnalysis::getSource(mlir::Value v) {
         attributes.set(Attribute::Pointer);
     }
 
-  if (type == SourceKind::Global)
+  if (type == SourceKind::Global || type == SourceKind::Direct)
----------------
kiranchandramohan wrote:

I am possibly wrong here. Settings of other compilers seem to suggest that globals and dummies do not alias.

from the oracle docs:
-xalias=no%dummy: The Fortran standard is followed and dummy arguments do not alias each other or global variables in the actual call. (This is the default.)

-fargument-noalias-global is the default for gfortran.
https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Aliasing-Assumed-To-Work.html (old page)

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


More information about the flang-commits mailing list