Skip to content

Commit 3585e69

Browse files
[Flang][Alias-analysis] Revert downstream changes (llvm#2563)
Revert downstream changes because upstream Flang adds alias tags to local objects by default (see: llvm#143489)
1 parent 22e40f5 commit 3585e69

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

clang/lib/Driver/ToolChains/Flang.cpp

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

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

flang/lib/Optimizer/Transforms/AddAliasTags.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static llvm::cl::opt<bool>
4444
enableDirect("direct-tbaa", llvm::cl::init(true), llvm::cl::Hidden,
4545
llvm::cl::desc("Add TBAA tags to direct variables"));
4646
static llvm::cl::opt<bool>
47-
enableLocalAllocs("tbaa-local-alloc", llvm::cl::init(true),
47+
enableLocalAllocs("local-alloc-tbaa", llvm::cl::init(true),
4848
llvm::cl::Hidden,
4949
llvm::cl::desc("Add TBAA tags to local allocations."));
5050

flang/test/Transforms/tbaa3.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: fir-opt --fir-add-alias-tags %s | FileCheck --check-prefixes=ALL,DEFAULT %s
2-
// RUN: fir-opt --fir-add-alias-tags --tbaa-local-alloc %s | FileCheck --check-prefixes=ALL,LOCAL %s
2+
// RUN: fir-opt --fir-add-alias-tags --local-alloc-tbaa %s | FileCheck --check-prefixes=ALL,LOCAL %s
33

44
// Test AddAliasTagsPass creating sub-tree for TARGET/POINTER variables.
55

flang/test/Transforms/tbaa4.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Test TBAA tags for common and equivalence.
22
// RUN: fir-opt --fir-add-alias-tags --split-input-file %s | FileCheck --check-prefixes=ALL,DEFAULT %s
3-
// RUN: fir-opt --fir-add-alias-tags --tbaa-local-alloc --split-input-file %s | FileCheck --check-prefixes=ALL,LOCAL %s
3+
// RUN: fir-opt --fir-add-alias-tags --local-alloc-tbaa --split-input-file %s | FileCheck --check-prefixes=ALL,LOCAL %s
44

55
// ALL: #[[ROOT:.+]] = #llvm.tbaa_root<id = "Flang function root _QPtest_common">
66
// ALL: #[[ANY:.+]] = #llvm.tbaa_type_desc<id = "any access", members = {<#[[ROOT]], 0>}>

0 commit comments

Comments
 (0)