[flang-commits] [flang] c76d853 - [flang][TBAABuilder] not all loads and stores are inside of functions (#84305)

via flang-commits flang-commits at lists.llvm.org
Fri Mar 8 02:34:04 PST 2024


Author: Tom Eccles
Date: 2024-03-08T10:34:00Z
New Revision: c76d853c176231b991cfc744e7cb69443ddc2268

URL: https://github.com/llvm/llvm-project/commit/c76d853c176231b991cfc744e7cb69443ddc2268
DIFF: https://github.com/llvm/llvm-project/commit/c76d853c176231b991cfc744e7cb69443ddc2268.diff

LOG: [flang][TBAABuilder] not all loads and stores are inside of functions (#84305)

TBAA builder assumed that all loads/stores are inside of functions and
hit an assertion once it found loads and stores inside of an
omp::ReductionDeclareOp.

For now just don't add TBAA tags to those loads and stores. They would
end up in a different TBAA tree to the host function after
OpenMPIRBuilder inlines them anyway so there isn't an easy way of making
this work.

Added: 
    

Modified: 
    flang/lib/Optimizer/CodeGen/TBAABuilder.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/CodeGen/TBAABuilder.cpp b/flang/lib/Optimizer/CodeGen/TBAABuilder.cpp
index 8e7f59f76383c9..b1b0e9b766a625 100644
--- a/flang/lib/Optimizer/CodeGen/TBAABuilder.cpp
+++ b/flang/lib/Optimizer/CodeGen/TBAABuilder.cpp
@@ -102,7 +102,8 @@ void TBAABuilder::attachTBAATag(AliasAnalysisOpInterface op, Type baseFIRType,
     return;
 
   mlir::LLVM::LLVMFuncOp func = op->getParentOfType<mlir::LLVM::LLVMFuncOp>();
-  assert(func && "func.func should have already been converted to llvm.func");
+  if (!func)
+    return;
 
   ++tagAttachmentCounter;
   if (tagAttachmentLimit != kTagAttachmentUnlimited &&


        


More information about the flang-commits mailing list