[flang-commits] [flang] [flang] AliasAnalysis: More formally define and distinguish between data and non-data (PR #91020)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Sat May 4 02:49:17 PDT 2024
================
@@ -154,18 +154,17 @@ void AddAliasTagsPass::runOnAliasInterface(fir::FirAliasTagOpInterface op,
// TBAA for global variables
} else if (enableGlobals &&
- source.kind == fir::AliasAnalysis::SourceKind::Global) {
- mlir::SymbolRefAttr glbl = source.u.get<mlir::SymbolRefAttr>();
+ source.kind == fir::AliasAnalysis::SourceKind::Global && !source.isBoxData()) {
+ mlir::SymbolRefAttr glbl = source.origin.u.get<mlir::SymbolRefAttr>();
const char *name = glbl.getRootReference().data();
LLVM_DEBUG(llvm::dbgs().indent(2) << "Found reference to global " << name
<< " at " << *op << "\n");
tag = state.getFuncTree(func).globalDataTree.getTag(name);
// TBAA for SourceKind::Direct
- } else if (enableDirect &&
- source.kind == fir::AliasAnalysis::SourceKind::Direct) {
- if (source.u.is<mlir::SymbolRefAttr>()) {
- mlir::SymbolRefAttr glbl = source.u.get<mlir::SymbolRefAttr>();
+ } else if (enableDirect && source.isBoxData()) {
----------------
tblah wrote:
Thanks for spotting this Slava, yes you were right here and the update was needed.
My intention behind this `enableDirect` path was for certain spec benchmarks with a lot of boxed arrays as globals. I agree that some better naming to make this clearer.
https://github.com/llvm/llvm-project/pull/91020
More information about the flang-commits
mailing list