Skip to content

Commit ba0182b

Browse files
committed
[flang][TBAABuilder] not all loads and stores are inside of functions
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. Commit series for by-ref OpenMP reductions: 2/3
1 parent 958ea36 commit ba0182b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Optimizer/CodeGen/TBAABuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ void TBAABuilder::attachTBAATag(AliasAnalysisOpInterface op, Type baseFIRType,
102102
return;
103103

104104
mlir::LLVM::LLVMFuncOp func = op->getParentOfType<mlir::LLVM::LLVMFuncOp>();
105-
assert(func && "func.func should have already been converted to llvm.func");
105+
if (!func)
106+
return;
106107

107108
++tagAttachmentCounter;
108109
if (tagAttachmentLimit != kTagAttachmentUnlimited &&

0 commit comments

Comments
 (0)