Skip to content

Commit 94b83de

Browse files
[Flang] Turn on alias analysis for locally allocated objects
We can turn on alias analysis for local objects for AOMP compiler. Usptream patch: llvm#139682 was reverted due to ARM-specific issue in Fujitsu test suite: https://github.com/fujitsu/compiler-test-suite/blob/main/Fortran/0614/0614_0005.f
1 parent a2cfc21 commit 94b83de

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,15 @@ void Flang::addTargetOptions(const ArgList &Args,
530530
CmdArgs.push_back(A->getValue());
531531
}
532532

533+
// FIXME: Remove it when local alias tags are generated by default
534+
// See: https://github.com/llvm/llvm-project/pull/139682
535+
// We need this downstream hack due to ARM failure for test case:
536+
// https://github.com/fujitsu/compiler-test-suite/blob/main/Fortran/0614/0614_0005.f
537+
if (!Triple.isARM()) {
538+
CmdArgs.push_back("-mmlir");
539+
CmdArgs.push_back("-local-alloc-tbaa");
540+
}
541+
533542
Args.addAllArgs(CmdArgs,
534543
{options::OPT_fverbose_asm, options::OPT_fno_verbose_asm});
535544
}

0 commit comments

Comments
 (0)