Skip to content

Conversation

@razvanlupusoru
Copy link
Contributor

This PR adds the necessary infrastructure to enable testing of the ACCImplicitData pass for FIR/HLFIR, along with comprehensive test coverage for implicit data clause generation in OpenACC constructs.

New Infrastructure:

  • Add FIROpenACCSupport analysis providing FIR-specific implementations of OpenACCSupport interface methods for variable name extraction, recipe name generation, and NYI emission
  • Add FIROpenACCUtils with helper functions for:
    • Variable name extraction from FIR operations (getVariableName)
    • Recipe name generation with FIR type string representation
    • Bounds checking for constant array sections
  • Add ACCInitializeFIRAnalyses pass to pre-register FIR analyses (OpenACCSupport and AliasAnalysis) for use by subsequent OpenACC passes in the pipeline

Refactoring in flang/lib/Lower/OpenACC.cpp:

  • Move bounds string generation and bounds checking to FIROpenACCUtils
  • Refactor recipe name generation to use fir::acc::getRecipeName

Test Coverage:

  • acc-implicit-firstprivate.fir: Tests implicit firstprivate behavior for scalar types (i8, i16, i32, i64, f32, f64, logical, complex) in parallel/serial constructs with recipe generation verification
  • acc-implicit-data.fir: Tests implicit data clauses for scalars, arrays, derived types, and boxes in kernels/parallel/serial with default(none) and default(present) variations
  • acc-implicit-data-fortran.F90: Fortran tests verifying implicit data generation through bbc with both HLFIR and FIR
  • acc-implicit-data-derived-type-member.F90: Tests correct ordering of parent/child data clause operations for derived type members
  • acc-implicit-copy-reduction.fir: Tests enable-implicit-reduction-copy flag controlling whether reduction variables use copy or firstprivate

This enables proper testing of implicit data clause generation through the flang optimizer pipeline for OpenACC directives.

This PR adds the necessary infrastructure to enable testing of
the ACCImplicitData pass for FIR/HLFIR, along with comprehensive
test coverage for implicit data clause generation in OpenACC
constructs.

New Infrastructure:
- Add FIROpenACCSupport analysis providing FIR-specific
  implementations of OpenACCSupport interface methods for variable
  name extraction, recipe name generation, and NYI emission
- Add FIROpenACCUtils with helper functions for:
  * Variable name extraction from FIR operations
    (getVariableName)
  * Recipe name generation with FIR type string representation
  * Bounds checking for constant array sections
- Add ACCInitializeFIRAnalyses pass to pre-register FIR analyses
  (OpenACCSupport and AliasAnalysis) for use by subsequent
  OpenACC passes in the pipeline

Refactoring in flang/lib/Lower/OpenACC.cpp:
- Move bounds string generation and bounds checking to
  FIROpenACCUtils
- Refactor recipe name generation to use
  fir::acc::getRecipeName

Test Coverage:
- acc-implicit-firstprivate.fir: Tests implicit firstprivate
  behavior for scalar types (i8, i16, i32, i64, f32, f64,
  logical, complex) in parallel/serial constructs with recipe
  generation verification
- acc-implicit-data.fir: Tests implicit data clauses for
  scalars, arrays, derived types, and boxes in
  kernels/parallel/serial with default(none) and
  default(present) variations
- acc-implicit-data-fortran.F90: Fortran tests verifying implicit
  data generation through bbc with both HLFIR and FIR
- acc-implicit-data-derived-type-member.F90: Tests correct
  ordering of parent/child data clause operations for derived
  type members
- acc-implicit-copy-reduction.fir: Tests
  enable-implicit-reduction-copy flag controlling whether
  reduction variables use copy or firstprivate

This enables proper testing of implicit data clause generation
through the flang optimizer pipeline for OpenACC directives.
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir openacc labels Nov 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 6, 2025

@llvm/pr-subscribers-flang-fir-hlfir

@llvm/pr-subscribers-openacc

Author: Razvan Lupusoru (razvanlupusoru)

Changes

This PR adds the necessary infrastructure to enable testing of the ACCImplicitData pass for FIR/HLFIR, along with comprehensive test coverage for implicit data clause generation in OpenACC constructs.

New Infrastructure:

  • Add FIROpenACCSupport analysis providing FIR-specific implementations of OpenACCSupport interface methods for variable name extraction, recipe name generation, and NYI emission
  • Add FIROpenACCUtils with helper functions for:
    • Variable name extraction from FIR operations (getVariableName)
    • Recipe name generation with FIR type string representation
    • Bounds checking for constant array sections
  • Add ACCInitializeFIRAnalyses pass to pre-register FIR analyses (OpenACCSupport and AliasAnalysis) for use by subsequent OpenACC passes in the pipeline

Refactoring in flang/lib/Lower/OpenACC.cpp:

  • Move bounds string generation and bounds checking to FIROpenACCUtils
  • Refactor recipe name generation to use fir::acc::getRecipeName

Test Coverage:

  • acc-implicit-firstprivate.fir: Tests implicit firstprivate behavior for scalar types (i8, i16, i32, i64, f32, f64, logical, complex) in parallel/serial constructs with recipe generation verification
  • acc-implicit-data.fir: Tests implicit data clauses for scalars, arrays, derived types, and boxes in kernels/parallel/serial with default(none) and default(present) variations
  • acc-implicit-data-fortran.F90: Fortran tests verifying implicit data generation through bbc with both HLFIR and FIR
  • acc-implicit-data-derived-type-member.F90: Tests correct ordering of parent/child data clause operations for derived type members
  • acc-implicit-copy-reduction.fir: Tests enable-implicit-reduction-copy flag controlling whether reduction variables use copy or firstprivate

This enables proper testing of implicit data clause generation through the flang optimizer pipeline for OpenACC directives.


Patch is 72.27 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/166797.diff

17 Files Affected:

  • (added) flang/include/flang/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.h (+51)
  • (modified) flang/include/flang/Optimizer/OpenACC/Passes.h (+4)
  • (modified) flang/include/flang/Optimizer/OpenACC/Passes.td (+16)
  • (added) flang/include/flang/Optimizer/OpenACC/Support/FIROpenACCUtils.h (+57)
  • (modified) flang/lib/Lower/OpenACC.cpp (+13-58)
  • (added) flang/lib/Optimizer/OpenACC/Analysis/CMakeLists.txt (+22)
  • (added) flang/lib/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.cpp (+40)
  • (modified) flang/lib/Optimizer/OpenACC/CMakeLists.txt (+1)
  • (modified) flang/lib/Optimizer/OpenACC/Support/CMakeLists.txt (+1)
  • (added) flang/lib/Optimizer/OpenACC/Support/FIROpenACCUtils.cpp (+275)
  • (added) flang/lib/Optimizer/OpenACC/Transforms/ACCInitializeFIRAnalyses.cpp (+56)
  • (modified) flang/lib/Optimizer/OpenACC/Transforms/CMakeLists.txt (+3)
  • (added) flang/test/Transforms/OpenACC/acc-implicit-copy-reduction.fir (+134)
  • (added) flang/test/Transforms/OpenACC/acc-implicit-data-derived-type-member.F90 (+38)
  • (added) flang/test/Transforms/OpenACC/acc-implicit-data-fortran.F90 (+79)
  • (added) flang/test/Transforms/OpenACC/acc-implicit-data.fir (+358)
  • (added) flang/test/Transforms/OpenACC/acc-implicit-firstprivate.fir (+284)
diff --git a/flang/include/flang/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.h b/flang/include/flang/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.h
new file mode 100644
index 0000000000000..c798681306c10
--- /dev/null
+++ b/flang/include/flang/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.h
@@ -0,0 +1,51 @@
+//===- FIROpenACCSupportAnalysis.h - FIR OpenACCSupport Analysis ----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the FIR-specific implementation of OpenACCSupport analysis.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_OPTIMIZER_OPENACC_ANALYSIS_FIROPENACCSUPPORTANALYSIS_H
+#define FORTRAN_OPTIMIZER_OPENACC_ANALYSIS_FIROPENACCSUPPORTANALYSIS_H
+
+#include "mlir/Dialect/OpenACC/OpenACC.h"
+#include "mlir/IR/Value.h"
+#include <string>
+
+namespace fir {
+namespace acc {
+
+/// FIR-specific implementation for the OpenACCSupport analysis interface.
+///
+/// This class provides the custom implementations of the OpenACCSupport
+/// interface methods that are tailored to FIR's requirements and
+/// can handle FIR dialect operations and types.
+/// Its primary intent is to be registered with the OpenACCSupport analysis
+/// using setImplementation()
+///
+/// Usage:
+///   auto &support = getAnalysis<mlir::acc::OpenACCSupport>();
+///   support.setImplementation(fir::acc::FIROpenACCSupportAnalysis());
+///
+class FIROpenACCSupportAnalysis {
+public:
+  FIROpenACCSupportAnalysis() = default;
+
+  std::string getVariableName(mlir::Value v);
+
+  std::string getRecipeName(mlir::acc::RecipeKind kind, mlir::Type type,
+                            mlir::Value var);
+
+  mlir::InFlightDiagnostic emitNYI(mlir::Location loc,
+                                   const mlir::Twine &message);
+};
+
+} // namespace acc
+} // namespace fir
+
+#endif // FORTRAN_OPTIMIZER_OPENACC_ANALYSIS_FIROPENACCSUPPORTANALYSIS_H
diff --git a/flang/include/flang/Optimizer/OpenACC/Passes.h b/flang/include/flang/Optimizer/OpenACC/Passes.h
index 0627cc8ce4a6d..c27c7ebc3b06f 100644
--- a/flang/include/flang/Optimizer/OpenACC/Passes.h
+++ b/flang/include/flang/Optimizer/OpenACC/Passes.h
@@ -13,6 +13,9 @@
 #ifndef FORTRAN_OPTIMIZER_OPENACC_PASSES_H
 #define FORTRAN_OPTIMIZER_OPENACC_PASSES_H
 
+#include "flang/Optimizer/Dialect/FIRDialect.h"
+#include "flang/Optimizer/HLFIR/HLFIRDialect.h"
+#include "mlir/Dialect/OpenACC/OpenACC.h"
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassRegistry.h"
@@ -25,6 +28,7 @@ namespace acc {
 #define GEN_PASS_REGISTRATION
 #include "flang/Optimizer/OpenACC/Passes.h.inc"
 
+std::unique_ptr<mlir::Pass> createACCInitializeFIRAnalysesPass();
 std::unique_ptr<mlir::Pass> createACCRecipeBufferizationPass();
 
 } // namespace acc
diff --git a/flang/include/flang/Optimizer/OpenACC/Passes.td b/flang/include/flang/Optimizer/OpenACC/Passes.td
index 3c127b30aa9b8..d947aa470494a 100644
--- a/flang/include/flang/Optimizer/OpenACC/Passes.td
+++ b/flang/include/flang/Optimizer/OpenACC/Passes.td
@@ -11,6 +11,22 @@
 
 include "mlir/Pass/PassBase.td"
 
+def ACCInitializeFIRAnalyses
+    : Pass<"acc-initialize-fir-analyses", "mlir::ModuleOp"> {
+  let summary = "Initialize FIR analyses for OpenACC passes";
+  let description = [{
+    This pass initializes analyses that can be used by subsequent OpenACC passes
+    in the pipeline. It creates and caches the OpenACCSupport analysis with a
+    FIR-specific implementation that can handle FIR types and operations.
+    It also initializes FIR's AliasAnalysis for use in OpenACC passes.
+    This pass needs to rerun if any analyses were invalidated by MLIR's framework.
+  }];
+  // In addition to pre-registering the needed analyses, this pass also
+  // pre-registers the dialects that various OpenACC passes may generate.
+  let dependentDialects = ["fir::FIROpsDialect", "hlfir::hlfirDialect",
+      "mlir::acc::OpenACCDialect"];
+}
+
 def ACCRecipeBufferization
     : Pass<"fir-acc-recipe-bufferization", "mlir::ModuleOp"> {
   let summary = "Rewrite acc.*.recipe box values to ref<box> and update uses";
diff --git a/flang/include/flang/Optimizer/OpenACC/Support/FIROpenACCUtils.h b/flang/include/flang/Optimizer/OpenACC/Support/FIROpenACCUtils.h
new file mode 100644
index 0000000000000..5ca0925ea681f
--- /dev/null
+++ b/flang/include/flang/Optimizer/OpenACC/Support/FIROpenACCUtils.h
@@ -0,0 +1,57 @@
+//===- FIROpenACCUtils.h - FIR OpenACC Utilities ----------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares utility functions for FIR OpenACC support.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_OPTIMIZER_OPENACC_SUPPORT_FIROPENACCUTILS_H
+#define FORTRAN_OPTIMIZER_OPENACC_SUPPORT_FIROPENACCUTILS_H
+
+#include "mlir/Dialect/OpenACC/OpenACC.h"
+#include "mlir/IR/Value.h"
+#include <string>
+
+namespace fir {
+namespace acc {
+
+/// Attempts to extract the variable name from a value by walking through
+/// FIR operations and looking for variable names.
+/// \param v The value to extract the variable name from
+/// \param preferDemangledName If true, prefers demangled/bindc names over
+///        mangled/unique names. If false, prefers mangled names.
+/// Returns empty string if no name is found.
+std::string getVariableName(mlir::Value v, bool preferDemangledName = true);
+
+/// Get the recipe name for a given recipe kind, FIR type, and optional
+/// variable. Uses FIR's type string representation with appropriate prefix. For
+/// firstprivate and reduction recipes, handles bounds suffix when all bounds
+/// are constant. For reduction recipes, embeds the operator name in the recipe.
+/// \param kind The recipe kind (private, firstprivate, or reduction)
+/// \param type The FIR type (must be a FIR type)
+/// \param var Optional variable value
+/// \param bounds Optional bounds for array sections (used for suffix
+/// generation)
+/// \param reductionOp Optional reduction operator (required for reduction
+/// recipes)
+/// \return The complete recipe name with all necessary suffixes
+std::string getRecipeName(mlir::acc::RecipeKind kind, mlir::Type type,
+                          mlir::Value var = nullptr,
+                          llvm::ArrayRef<mlir::Value> bounds = {},
+                          mlir::acc::ReductionOperator reductionOp =
+                              mlir::acc::ReductionOperator::AccNone);
+
+/// Check if all bounds are expressed with constant values.
+/// \param bounds Array of DataBoundsOp values to check
+/// \return true if all bounds have constant lowerbound/upperbound or extent
+bool areAllBoundsConstant(llvm::ArrayRef<mlir::Value> bounds);
+
+} // namespace acc
+} // namespace fir
+
+#endif // FORTRAN_OPTIMIZER_OPENACC_SUPPORT_FIROPENACCUTILS_H
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 1f75ed1d8e6a1..224ce44917773 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -28,6 +28,7 @@
 #include "flang/Optimizer/Builder/IntrinsicCall.h"
 #include "flang/Optimizer/Builder/Todo.h"
 #include "flang/Optimizer/Dialect/FIRType.h"
+#include "flang/Optimizer/OpenACC/Support/FIROpenACCUtils.h"
 #include "flang/Parser/parse-tree-visitor.h"
 #include "flang/Parser/parse-tree.h"
 #include "flang/Parser/tools.h"
@@ -1159,18 +1160,6 @@ bool isConstantBound(mlir::acc::DataBoundsOp &op) {
   return false;
 }
 
-/// Return true iff all the bounds are expressed with constant values.
-bool areAllBoundConstant(const llvm::SmallVector<mlir::Value> &bounds) {
-  for (auto bound : bounds) {
-    auto dataBound =
-        mlir::dyn_cast<mlir::acc::DataBoundsOp>(bound.getDefiningOp());
-    assert(dataBound && "Must be DataBoundOp operation");
-    if (!isConstantBound(dataBound))
-      return false;
-  }
-  return true;
-}
-
 static llvm::SmallVector<mlir::Value>
 genConstantBounds(fir::FirOpBuilder &builder, mlir::Location loc,
                   mlir::acc::DataBoundsOp &dataBound) {
@@ -1207,7 +1196,7 @@ static mlir::Value genShapeFromBoundsOrArgs(
       return hlfir::genShape(loc, builder, entity);
     }
     return genShapeOp(builder, seqTy, loc).getResult();
-  } else if (areAllBoundConstant(bounds)) {
+  } else if (fir::acc::areAllBoundsConstant(bounds)) {
     for (auto bound : llvm::reverse(bounds)) {
       auto dataBound =
           mlir::cast<mlir::acc::DataBoundsOp>(bound.getDefiningOp());
@@ -1274,7 +1263,7 @@ mlir::acc::FirstprivateRecipeOp Fortran::lower::createOrGetFirstprivateRecipe(
   auto ip = builder.saveInsertionPoint();
   auto recipe = genRecipeOp<mlir::acc::FirstprivateRecipeOp>(
       builder, mod, recipeName, loc, ty);
-  bool allConstantBound = areAllBoundConstant(bounds);
+  bool allConstantBound = fir::acc::areAllBoundsConstant(bounds);
   llvm::SmallVector<mlir::Type> argsTy{ty, ty};
   llvm::SmallVector<mlir::Location> argsLoc{loc, loc};
   if (!allConstantBound) {
@@ -1358,33 +1347,6 @@ mlir::acc::FirstprivateRecipeOp Fortran::lower::createOrGetFirstprivateRecipe(
   return recipe;
 }
 
-/// Get a string representation of the bounds.
-std::string getBoundsString(llvm::SmallVector<mlir::Value> &bounds) {
-  std::stringstream boundStr;
-  if (!bounds.empty())
-    boundStr << "_section_";
-  llvm::interleave(
-      bounds,
-      [&](mlir::Value bound) {
-        auto boundsOp =
-            mlir::cast<mlir::acc::DataBoundsOp>(bound.getDefiningOp());
-        if (boundsOp.getLowerbound() &&
-            fir::getIntIfConstant(boundsOp.getLowerbound()) &&
-            boundsOp.getUpperbound() &&
-            fir::getIntIfConstant(boundsOp.getUpperbound())) {
-          boundStr << "lb" << *fir::getIntIfConstant(boundsOp.getLowerbound())
-                   << ".ub" << *fir::getIntIfConstant(boundsOp.getUpperbound());
-        } else if (boundsOp.getExtent() &&
-                   fir::getIntIfConstant(boundsOp.getExtent())) {
-          boundStr << "ext" << *fir::getIntIfConstant(boundsOp.getExtent());
-        } else {
-          boundStr << "?";
-        }
-      },
-      [&] { boundStr << "x"; });
-  return boundStr.str();
-}
-
 /// Rebuild the array type from the acc.bounds operation with constant
 /// lowerbound/upperbound or extent.
 mlir::Type getTypeFromBounds(llvm::SmallVector<mlir::Value> &bounds,
@@ -1458,9 +1420,8 @@ static void genPrivatizationRecipes(
     RecipeOp recipe;
     mlir::Type retTy = getTypeFromBounds(bounds, info.addr.getType());
     if constexpr (std::is_same_v<RecipeOp, mlir::acc::PrivateRecipeOp>) {
-      std::string recipeName =
-          fir::getTypeAsString(retTy, converter.getKindMap(),
-                               Fortran::lower::privatizationRecipePrefix);
+      std::string recipeName = fir::acc::getRecipeName(
+          mlir::acc::RecipeKind::private_recipe, retTy, info.addr, bounds);
       recipe = Fortran::lower::createOrGetPrivateRecipe(builder, recipeName,
                                                         operandLocation, retTy);
       auto op = createDataEntryOp<mlir::acc::PrivateOp>(
@@ -1474,10 +1435,8 @@ static void genPrivatizationRecipes(
         symbolPairs->emplace_back(op.getAccVar(),
                                   Fortran::semantics::SymbolRef(symbol));
     } else {
-      std::string suffix =
-          areAllBoundConstant(bounds) ? getBoundsString(bounds) : "";
-      std::string recipeName = fir::getTypeAsString(
-          retTy, converter.getKindMap(), "firstprivatization" + suffix);
+      std::string recipeName = fir::acc::getRecipeName(
+          mlir::acc::RecipeKind::firstprivate_recipe, retTy, info.addr, bounds);
       recipe = Fortran::lower::createOrGetFirstprivateRecipe(
           builder, recipeName, operandLocation, retTy, bounds);
       auto op = createDataEntryOp<mlir::acc::FirstprivateOp>(
@@ -1829,7 +1788,7 @@ mlir::acc::ReductionRecipeOp Fortran::lower::createOrGetReductionRecipe(
   // for the combiner if needed.
   llvm::SmallVector<mlir::Type> argsTy{ty, ty};
   llvm::SmallVector<mlir::Location> argsLoc{loc, loc};
-  bool allConstantBound = areAllBoundConstant(bounds);
+  bool allConstantBound = fir::acc::areAllBoundsConstant(bounds);
   if (!allConstantBound) {
     for (mlir::Value bound : llvm::reverse(bounds)) {
       auto dataBound =
@@ -1911,15 +1870,12 @@ genReductions(const Fortran::parser::AccObjectListWithReduction &objectList,
         mlir::acc::DataClause::acc_reduction, info.addr.getType(), async,
         asyncDeviceTypes, asyncOnlyDeviceTypes, /*unwrapBoxAddr=*/true);
     mlir::Type ty = op.getAccVar().getType();
-    if (!areAllBoundConstant(bounds) ||
+    if (!fir::acc::areAllBoundsConstant(bounds) ||
         fir::isAssumedShape(info.addr.getType()) ||
         fir::isAllocatableOrPointerArray(info.addr.getType()))
       ty = info.addr.getType();
-    std::string suffix =
-        areAllBoundConstant(bounds) ? getBoundsString(bounds) : "";
-    std::string recipeName = fir::getTypeAsString(
-        ty, converter.getKindMap(),
-        ("reduction_" + stringifyReductionOperator(mlirOp)).str() + suffix);
+    std::string recipeName = fir::acc::getRecipeName(
+        mlir::acc::RecipeKind::reduction_recipe, ty, info.addr, bounds, mlirOp);
 
     mlir::acc::ReductionRecipeOp recipe =
         Fortran::lower::createOrGetReductionRecipe(
@@ -2164,9 +2120,8 @@ static void privatizeIv(
   }
 
   if (privateOp == nullptr) {
-    std::string recipeName =
-        fir::getTypeAsString(ivValue.getType(), converter.getKindMap(),
-                             Fortran::lower::privatizationRecipePrefix);
+    std::string recipeName = fir::acc::getRecipeName(
+        mlir::acc::RecipeKind::private_recipe, ivValue.getType(), ivValue, {});
     auto recipe = Fortran::lower::createOrGetPrivateRecipe(
         builder, recipeName, loc, ivValue.getType());
 
diff --git a/flang/lib/Optimizer/OpenACC/Analysis/CMakeLists.txt b/flang/lib/Optimizer/OpenACC/Analysis/CMakeLists.txt
new file mode 100644
index 0000000000000..e05d1456e6dba
--- /dev/null
+++ b/flang/lib/Optimizer/OpenACC/Analysis/CMakeLists.txt
@@ -0,0 +1,22 @@
+add_flang_library(FIROpenACCAnalysis
+  FIROpenACCSupportAnalysis.cpp
+
+  DEPENDS
+  FIRAnalysis
+  FIRDialect
+  FIROpenACCSupport
+  HLFIRDialect
+
+  LINK_LIBS
+  FIRAnalysis
+  FIRDialect
+  FIROpenACCSupport
+  HLFIRDialect
+
+  MLIR_DEPS
+  MLIROpenACCDialect
+
+  MLIR_LIBS
+  MLIROpenACCDialect
+)
+
diff --git a/flang/lib/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.cpp b/flang/lib/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.cpp
new file mode 100644
index 0000000000000..8cdbe1d5b170e
--- /dev/null
+++ b/flang/lib/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.cpp
@@ -0,0 +1,40 @@
+//===- FIROpenACCSupportAnalysis.cpp - FIR OpenACCSupport Analysis -------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the FIR-specific OpenACCSupport analysis.
+//
+//===----------------------------------------------------------------------===//
+
+#include "flang/Optimizer/OpenACC/Analysis/FIROpenACCSupportAnalysis.h"
+#include "flang/Optimizer/Builder/Todo.h"
+#include "flang/Optimizer/OpenACC/Support/FIROpenACCUtils.h"
+
+using namespace mlir;
+
+namespace fir {
+namespace acc {
+
+std::string FIROpenACCSupportAnalysis::getVariableName(Value v) {
+  return fir::acc::getVariableName(v, /*preferDemangledName=*/true);
+}
+
+std::string FIROpenACCSupportAnalysis::getRecipeName(mlir::acc::RecipeKind kind,
+                                                     Type type, Value var) {
+  return fir::acc::getRecipeName(kind, type, var);
+}
+
+mlir::InFlightDiagnostic
+FIROpenACCSupportAnalysis::emitNYI(Location loc, const Twine &message) {
+  TODO(loc, message);
+  // Should be unreachable, but we return an actual diagnostic
+  // to satisfy the interface.
+  return mlir::emitError(loc, "not yet implemented: " + message.str());
+}
+
+} // namespace acc
+} // namespace fir
diff --git a/flang/lib/Optimizer/OpenACC/CMakeLists.txt b/flang/lib/Optimizer/OpenACC/CMakeLists.txt
index 790b9fdb1589a..16a40254dbfe9 100644
--- a/flang/lib/Optimizer/OpenACC/CMakeLists.txt
+++ b/flang/lib/Optimizer/OpenACC/CMakeLists.txt
@@ -1,2 +1,3 @@
+add_subdirectory(Analysis)
 add_subdirectory(Support)
 add_subdirectory(Transforms)
diff --git a/flang/lib/Optimizer/OpenACC/Support/CMakeLists.txt b/flang/lib/Optimizer/OpenACC/Support/CMakeLists.txt
index 898fb00d41dfe..9c6f0ee74f4cf 100644
--- a/flang/lib/Optimizer/OpenACC/Support/CMakeLists.txt
+++ b/flang/lib/Optimizer/OpenACC/Support/CMakeLists.txt
@@ -4,6 +4,7 @@ add_flang_library(FIROpenACCSupport
   FIROpenACCAttributes.cpp
   FIROpenACCOpsInterfaces.cpp
   FIROpenACCTypeInterfaces.cpp
+  FIROpenACCUtils.cpp
   RegisterOpenACCExtensions.cpp
 
   DEPENDS
diff --git a/flang/lib/Optimizer/OpenACC/Support/FIROpenACCUtils.cpp b/flang/lib/Optimizer/OpenACC/Support/FIROpenACCUtils.cpp
new file mode 100644
index 0000000000000..cc4bb4175c5f3
--- /dev/null
+++ b/flang/lib/Optimizer/OpenACC/Support/FIROpenACCUtils.cpp
@@ -0,0 +1,275 @@
+//===- FIROpenACCUtils.cpp - FIR OpenACC Utilities ------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements utility functions for FIR OpenACC support.
+//
+//===----------------------------------------------------------------------===//
+
+#include "flang/Optimizer/OpenACC/Support/FIROpenACCUtils.h"
+#include "flang/Optimizer/Dialect/FIROps.h"
+#include "flang/Optimizer/Dialect/FIROpsSupport.h"
+#include "flang/Optimizer/Dialect/FIRType.h"
+#include "flang/Optimizer/Dialect/Support/FIRContext.h"
+#include "flang/Optimizer/Dialect/Support/KindMapping.h"
+#include "flang/Optimizer/HLFIR/HLFIROps.h"
+#include "flang/Optimizer/Support/InternalNames.h"
+#include "mlir/Dialect/OpenACC/OpenACC.h"
+#include "mlir/IR/Matchers.h"
+#include "mlir/Interfaces/ViewLikeInterface.h"
+#include "llvm/ADT/TypeSwitch.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace mlir;
+
+namespace fir {
+namespace acc {
+
+std::string getVariableName(Value v, bool preferDemangledName) {
+  std::string srcName;
+  std::string prefix;
+  llvm::SmallVector<std::string, 4> arrayIndices;
+  bool iterate = true;
+  mlir::Operation *defOp;
+
+  // For integer constants, no need to further iterate - print their value
+  // immediately.
+  if (v.getDefiningOp()) {
+    IntegerAttr::ValueType val;
+    if (matchPattern(v.getDefiningOp(), m_ConstantInt(&val))) {
+      llvm::raw_string_ostream os(prefix);
+      val.print(os, /*isSigned=*/true);
+      return prefix;
+    }
+  }
+
+  while (v && (defOp = v.getDefiningOp()) && iterate) {
+    iterate =
+        llvm::TypeSwitch<mlir::Operation *, bool>(defOp)
+            .Case<mlir::ViewLikeOpInterface>(
+                [&v](mlir::ViewLikeOpInterface op) {
+                  v = op.getViewSource();
+                  return true;
+                })
+            .Case<fir::ReboxOp>([&v](fir::ReboxOp op) {
+              v = op.getBox();
+              return true;
+            })
+            .Case<fir::EmboxOp>([&v](fir::EmboxOp op) {
+              v = op.getMemref();
+              return true;
+            })
+            .Case<fir::ConvertOp>([&v](fir::ConvertOp op) {
+              v = op.getValue();
+              return true;
+            })
+            .Case<fir::LoadOp>([&v](fir::LoadOp op) {
+              v = op.getMemref();
+              return true;
+    ...
[truncated]

Copy link
Contributor

@vzakhari vzakhari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!!!

Comment on lines +212 to +223
if (boundsOp.getLowerbound() &&
fir::getIntIfConstant(boundsOp.getLowerbound()) &&
boundsOp.getUpperbound() &&
fir::getIntIfConstant(boundsOp.getUpperbound())) {
os << "lb" << *fir::getIntIfConstant(boundsOp.getLowerbound())
<< ".ub" << *fir::getIntIfConstant(boundsOp.getUpperbound());
} else if (boundsOp.getExtent() &&
fir::getIntIfConstant(boundsOp.getExtent())) {
os << "ext" << *fir::getIntIfConstant(boundsOp.getExtent());
} else {
os << "?";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no braces

Copy link
Contributor Author

@razvanlupusoru razvanlupusoru Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation because of the multi-line conditions was really off - so I did not do this!

Copy link
Contributor

@clementval clementval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of braces to remove otherwise LGTM

@razvanlupusoru razvanlupusoru enabled auto-merge (squash) November 6, 2025 20:31
@razvanlupusoru razvanlupusoru merged commit c12cb28 into llvm:main Nov 6, 2025
8 of 9 checks passed
@jplehr
Copy link
Contributor

jplehr commented Nov 6, 2025

Hi, it appears that this broke one of our bots: https://lab.llvm.org/staging/#/builders/105/builds/36037

@razvanlupusoru
Copy link
Contributor Author

Hi, it appears that this broke one of our bots: https://lab.llvm.org/staging/#/builders/105/builds/36037

Sorry about that. I have merged the fix: #166853

@jplehr
Copy link
Contributor

jplehr commented Nov 6, 2025

Thank you. :)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 6, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-sharedlibs running on linaro-flang-aarch64-sharedlibs while building flang at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/17409

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
382.323 [65/8/7918] Linking CXX shared library lib/libFIROpenACCSupport.so.22.0git
382.325 [64/8/7919] Creating library symlink lib/libFortranUtils.so
382.334 [64/7/7920] Creating library symlink lib/libFIROpenACCSupport.so
382.354 [62/8/7921] Linking CXX shared library lib/libFIRAnalysis.so.22.0git
382.364 [61/8/7922] Creating library symlink lib/libFIRAnalysis.so
382.677 [58/10/7923] Linking CXX shared library lib/libFIRTestOpenACCInterfaces.so.22.0git
382.685 [57/10/7924] Creating library symlink lib/libFIRTestOpenACCInterfaces.so
382.699 [57/9/7925] Linking CXX shared library lib/libFIROpenACCAnalysis.so.22.0git
382.707 [56/9/7926] Creating library symlink lib/libFIROpenACCAnalysis.so
383.060 [55/9/7927] Linking CXX shared library lib/libFIROpenACCTransforms.so.22.0git
FAILED: lib/libFIROpenACCTransforms.so.22.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported -Wno-unused-command-line-argument -Wstring-conversion           -Wcovered-switch-default -Wno-nested-anon-types -Xclang -fno-pch-timestamp -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libFIROpenACCTransforms.so.22.0git -o lib/libFIROpenACCTransforms.so.22.0git tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCRecipeBufferization.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib:"  lib/libFIROpenACCAnalysis.so.22.0git  lib/libHLFIRDialect.so.22.0git  lib/libFIRDialect.so.22.0git  lib/libMLIROpenACCDialect.so.22.0git  lib/libMLIRMemRefDialect.so.22.0git  lib/libMLIRArithUtils.so.22.0git  lib/libMLIRComplexDialect.so.22.0git  lib/libMLIRDialectUtils.so.22.0git  lib/libMLIRArithDialect.so.22.0git  lib/libMLIRInferIntRangeCommon.so.22.0git  lib/libMLIRShapedOpInterfaces.so.22.0git  lib/libMLIRCastInterfaces.so.22.0git  lib/libMLIRDialect.so.22.0git  lib/libMLIRUBDialect.so.22.0git  lib/libMLIRLLVMDialect.so.22.0git  lib/libMLIRPtrMemorySpaceInterfaces.so.22.0git  lib/libMLIROpenACCMPCommon.so.22.0git  lib/libMLIRMemorySlotInterfaces.so.22.0git  lib/libMLIRMemOpInterfaces.so.22.0git  lib/libMLIRValueBoundsOpInterface.so.22.0git  lib/libMLIRDestinationStyleOpInterface.so.22.0git  lib/libMLIRPass.so.22.0git  lib/libMLIRAnalysis.so.22.0git  lib/libMLIRControlFlowInterfaces.so.22.0git  lib/libMLIRDataLayoutInterfaces.so.22.0git  lib/libMLIRInferStridedMetadataInterface.so.22.0git  lib/libMLIRInferIntRangeInterface.so.22.0git  lib/libMLIRLoopLikeInterface.so.22.0git  lib/libMLIRPresburger.so.22.0git  lib/libMLIRViewLikeInterface.so.22.0git  lib/libMLIRFunctionInterfaces.so.22.0git  lib/libMLIRCallInterfaces.so.22.0git  lib/libMLIRInferTypeOpInterface.so.22.0git  lib/libMLIRSideEffectInterfaces.so.22.0git  lib/libMLIRIR.so.22.0git  lib/libMLIRSupport.so.22.0git  lib/libLLVMCore.so.22.0git  lib/libLLVMBinaryFormat.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib && :
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::alias(mlir::Value, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_]+0x4): undefined reference to `fir::AliasAnalysis::alias(mlir::Value, mlir::Value)'
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::getModRef(mlir::Operation*, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE]+0x4): undefined reference to `fir::AliasAnalysis::getModRef(mlir::Operation*, mlir::Value)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
383.245 [55/8/7928] Linking CXX shared library lib/libFIRCodeGen.so.22.0git
384.125 [55/7/7929] Linking CXX shared library lib/libFlangOpenMPTransforms.so.22.0git
384.964 [55/6/7930] Linking CXX executable bin/fir-lsp-server
388.537 [55/5/7931] Linking CXX shared library lib/libFortranSemantics.so.22.0git
390.350 [55/4/7932] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o
415.287 [55/3/7933] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o
420.856 [55/2/7934] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Clauses.cpp.o
622.584 [55/1/7935] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 7, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-9-cmake-build-only running on rocm-docker-rhel-9 while building flang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/205/builds/27181

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[7890/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ExternalNameConversion.cpp.o
[7891/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/MapInfoFinalization.cpp.o
[7892/8192] Building CXX object tools/flang/lib/Optimizer/OpenACC/Support/CMakeFiles/FIROpenACCSupport.dir/FIROpenACCTypeInterfaces.cpp.o
[7893/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o
[7894/8192] Linking CXX shared library lib/libFIROpenACCSupport.so.22.0git
[7895/8192] Creating library symlink lib/libFIROpenACCSupport.so
[7896/8192] Linking CXX shared library lib/libFIROpenACCAnalysis.so.22.0git
[7897/8192] Creating library symlink lib/libFIROpenACCAnalysis.so
[7898/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/FunctionFiltering.cpp.o
[7899/8192] Linking CXX shared library lib/libFIROpenACCTransforms.so.22.0git
FAILED: lib/libFIROpenACCTransforms.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libFIROpenACCTransforms.so.22.0git -o lib/libFIROpenACCTransforms.so.22.0git tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCRecipeBufferization.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib:"  lib/libFIROpenACCAnalysis.so.22.0git  lib/libHLFIRDialect.so.22.0git  lib/libFIRDialect.so.22.0git  lib/libMLIROpenACCDialect.so.22.0git  lib/libMLIRMemRefDialect.so.22.0git  lib/libMLIRArithUtils.so.22.0git  lib/libMLIRComplexDialect.so.22.0git  lib/libMLIRDialectUtils.so.22.0git  lib/libMLIRArithDialect.so.22.0git  lib/libMLIRInferIntRangeCommon.so.22.0git  lib/libMLIRShapedOpInterfaces.so.22.0git  lib/libMLIRCastInterfaces.so.22.0git  lib/libMLIRDialect.so.22.0git  lib/libMLIRUBDialect.so.22.0git  lib/libMLIRLLVMDialect.so.22.0git  lib/libMLIRPtrMemorySpaceInterfaces.so.22.0git  lib/libMLIROpenACCMPCommon.so.22.0git  lib/libMLIRMemorySlotInterfaces.so.22.0git  lib/libMLIRMemOpInterfaces.so.22.0git  lib/libMLIRValueBoundsOpInterface.so.22.0git  lib/libMLIRDestinationStyleOpInterface.so.22.0git  lib/libMLIRPass.so.22.0git  lib/libMLIRAnalysis.so.22.0git  lib/libMLIRControlFlowInterfaces.so.22.0git  lib/libMLIRDataLayoutInterfaces.so.22.0git  lib/libMLIRInferStridedMetadataInterface.so.22.0git  lib/libMLIRInferIntRangeInterface.so.22.0git  lib/libMLIRLoopLikeInterface.so.22.0git  lib/libMLIRPresburger.so.22.0git  lib/libMLIRViewLikeInterface.so.22.0git  lib/libMLIRFunctionInterfaces.so.22.0git  lib/libMLIRCallInterfaces.so.22.0git  lib/libMLIRInferTypeOpInterface.so.22.0git  lib/libMLIRSideEffectInterfaces.so.22.0git  lib/libMLIRIR.so.22.0git  lib/libMLIRSupport.so.22.0git  lib/libLLVMCore.so.22.0git  lib/libLLVMBinaryFormat.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib && :
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::getModRef(mlir::Operation*, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE]+0x5): undefined reference to `fir::AliasAnalysis::getModRef(mlir::Operation*, mlir::Value)'
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::alias(mlir::Value, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_]+0x5): undefined reference to `fir::AliasAnalysis::alias(mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[7900/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/MapsForPrivatizedSymbols.cpp.o
[7901/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/Support/CMakeFiles/FIROpenMPSupport.dir/FIROpenMPAttributes.cpp.o
[7902/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ConstantArgumentGlobalisation.cpp.o
[7903/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/ClauseProcessor.cpp.o
[7904/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/MemoryAllocation.cpp.o
[7905/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/CompilerGeneratedNames.cpp.o
[7906/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackReclaim.cpp.o
[7907/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Utils.cpp.o
[7908/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/DebugTypeGenerator.cpp.o
[7909/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/VScaleAttr.cpp.o
[7910/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/LoopVersioning.cpp.o
[7911/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/SimplifyIntrinsics.cpp.o
[7912/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackArrays.cpp.o
[7913/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/FunctionAttr.cpp.o
[7914/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/SetRuntimeCallAttributes.cpp.o
[7915/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/GenRuntimeCallsForTest.cpp.o
[7916/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/AddDebugInfo.cpp.o
[7917/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/SimplifyFIROperations.cpp.o
[7918/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/OptimizeArrayRepacking.cpp.o
[7919/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/DoConcurrentConversion.cpp.o
[7920/8192] Building CXX object tools/flang/lib/Optimizer/HLFIR/Transforms/CMakeFiles/HLFIRTransforms.dir/SimplifyHLFIRIntrinsics.cpp.o
[7921/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/PolymorphicOpConversion.cpp.o
[7922/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Decomposer.cpp.o
[7923/8192] Building CXX object tools/flang/lib/Optimizer/HLFIR/Transforms/CMakeFiles/HLFIRTransforms.dir/LowerHLFIRIntrinsics.cpp.o
[7924/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendActions.cpp.o
[7925/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Support/Utils.cpp.o
[7926/8192] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-omp-atomic.cpp.o
[7927/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Clauses.cpp.o
[7928/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o
[7929/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o
[7930/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o
[7931/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[7890/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ExternalNameConversion.cpp.o
[7891/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/MapInfoFinalization.cpp.o
[7892/8192] Building CXX object tools/flang/lib/Optimizer/OpenACC/Support/CMakeFiles/FIROpenACCSupport.dir/FIROpenACCTypeInterfaces.cpp.o
[7893/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o
[7894/8192] Linking CXX shared library lib/libFIROpenACCSupport.so.22.0git
[7895/8192] Creating library symlink lib/libFIROpenACCSupport.so
[7896/8192] Linking CXX shared library lib/libFIROpenACCAnalysis.so.22.0git
[7897/8192] Creating library symlink lib/libFIROpenACCAnalysis.so
[7898/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/FunctionFiltering.cpp.o
[7899/8192] Linking CXX shared library lib/libFIROpenACCTransforms.so.22.0git
FAILED: lib/libFIROpenACCTransforms.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libFIROpenACCTransforms.so.22.0git -o lib/libFIROpenACCTransforms.so.22.0git tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCRecipeBufferization.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib:"  lib/libFIROpenACCAnalysis.so.22.0git  lib/libHLFIRDialect.so.22.0git  lib/libFIRDialect.so.22.0git  lib/libMLIROpenACCDialect.so.22.0git  lib/libMLIRMemRefDialect.so.22.0git  lib/libMLIRArithUtils.so.22.0git  lib/libMLIRComplexDialect.so.22.0git  lib/libMLIRDialectUtils.so.22.0git  lib/libMLIRArithDialect.so.22.0git  lib/libMLIRInferIntRangeCommon.so.22.0git  lib/libMLIRShapedOpInterfaces.so.22.0git  lib/libMLIRCastInterfaces.so.22.0git  lib/libMLIRDialect.so.22.0git  lib/libMLIRUBDialect.so.22.0git  lib/libMLIRLLVMDialect.so.22.0git  lib/libMLIRPtrMemorySpaceInterfaces.so.22.0git  lib/libMLIROpenACCMPCommon.so.22.0git  lib/libMLIRMemorySlotInterfaces.so.22.0git  lib/libMLIRMemOpInterfaces.so.22.0git  lib/libMLIRValueBoundsOpInterface.so.22.0git  lib/libMLIRDestinationStyleOpInterface.so.22.0git  lib/libMLIRPass.so.22.0git  lib/libMLIRAnalysis.so.22.0git  lib/libMLIRControlFlowInterfaces.so.22.0git  lib/libMLIRDataLayoutInterfaces.so.22.0git  lib/libMLIRInferStridedMetadataInterface.so.22.0git  lib/libMLIRInferIntRangeInterface.so.22.0git  lib/libMLIRLoopLikeInterface.so.22.0git  lib/libMLIRPresburger.so.22.0git  lib/libMLIRViewLikeInterface.so.22.0git  lib/libMLIRFunctionInterfaces.so.22.0git  lib/libMLIRCallInterfaces.so.22.0git  lib/libMLIRInferTypeOpInterface.so.22.0git  lib/libMLIRSideEffectInterfaces.so.22.0git  lib/libMLIRIR.so.22.0git  lib/libMLIRSupport.so.22.0git  lib/libLLVMCore.so.22.0git  lib/libLLVMBinaryFormat.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib && :
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::getModRef(mlir::Operation*, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE]+0x5): undefined reference to `fir::AliasAnalysis::getModRef(mlir::Operation*, mlir::Value)'
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::alias(mlir::Value, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_]+0x5): undefined reference to `fir::AliasAnalysis::alias(mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[7900/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/MapsForPrivatizedSymbols.cpp.o
[7901/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/Support/CMakeFiles/FIROpenMPSupport.dir/FIROpenMPAttributes.cpp.o
[7902/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ConstantArgumentGlobalisation.cpp.o
[7903/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/ClauseProcessor.cpp.o
[7904/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/MemoryAllocation.cpp.o
[7905/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/CompilerGeneratedNames.cpp.o
[7906/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackReclaim.cpp.o
[7907/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Utils.cpp.o
[7908/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/DebugTypeGenerator.cpp.o
[7909/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/VScaleAttr.cpp.o
[7910/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/LoopVersioning.cpp.o
[7911/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/SimplifyIntrinsics.cpp.o
[7912/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackArrays.cpp.o
[7913/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/FunctionAttr.cpp.o
[7914/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/SetRuntimeCallAttributes.cpp.o
[7915/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/GenRuntimeCallsForTest.cpp.o
[7916/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/AddDebugInfo.cpp.o
[7917/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/SimplifyFIROperations.cpp.o
[7918/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/OptimizeArrayRepacking.cpp.o
[7919/8192] Building CXX object tools/flang/lib/Optimizer/OpenMP/CMakeFiles/FlangOpenMPTransforms.dir/DoConcurrentConversion.cpp.o
[7920/8192] Building CXX object tools/flang/lib/Optimizer/HLFIR/Transforms/CMakeFiles/HLFIRTransforms.dir/SimplifyHLFIRIntrinsics.cpp.o
[7921/8192] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/PolymorphicOpConversion.cpp.o
[7922/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Decomposer.cpp.o
[7923/8192] Building CXX object tools/flang/lib/Optimizer/HLFIR/Transforms/CMakeFiles/HLFIRTransforms.dir/LowerHLFIRIntrinsics.cpp.o
[7924/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendActions.cpp.o
[7925/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Support/Utils.cpp.o
[7926/8192] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-omp-atomic.cpp.o
[7927/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Clauses.cpp.o
[7928/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o
[7929/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o
[7930/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o
[7931/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 7, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-ubuntu-22-cmake-build-only running on rocm-docker-ubu-22 while building flang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/203/builds/28390

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[8088/8192] Creating library symlink lib/libFIROpenMPSupport.so
[8089/8192] Linking CXX shared library lib/libFortranUtils.so.22.0git
[8090/8192] Creating library symlink lib/libFortranUtils.so
[8091/8192] Linking CXX shared library lib/libFIROpenACCSupport.so.22.0git
[8092/8192] Creating library symlink lib/libFIROpenACCSupport.so
[8093/8192] Linking CXX shared library lib/libFIRAnalysis.so.22.0git
[8094/8192] Creating library symlink lib/libFIRAnalysis.so
[8095/8192] Linking CXX shared library lib/libFIROpenACCAnalysis.so.22.0git
[8096/8192] Creating library symlink lib/libFIROpenACCAnalysis.so
[8097/8192] Linking CXX shared library lib/libFIROpenACCTransforms.so.22.0git
FAILED: lib/libFIROpenACCTransforms.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libFIROpenACCTransforms.so.22.0git -o lib/libFIROpenACCTransforms.so.22.0git tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCRecipeBufferization.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib:"  lib/libFIROpenACCAnalysis.so.22.0git  lib/libHLFIRDialect.so.22.0git  lib/libFIRDialect.so.22.0git  lib/libMLIROpenACCDialect.so.22.0git  lib/libMLIRMemRefDialect.so.22.0git  lib/libMLIRArithUtils.so.22.0git  lib/libMLIRComplexDialect.so.22.0git  lib/libMLIRDialectUtils.so.22.0git  lib/libMLIRArithDialect.so.22.0git  lib/libMLIRInferIntRangeCommon.so.22.0git  lib/libMLIRShapedOpInterfaces.so.22.0git  lib/libMLIRCastInterfaces.so.22.0git  lib/libMLIRDialect.so.22.0git  lib/libMLIRUBDialect.so.22.0git  lib/libMLIRLLVMDialect.so.22.0git  lib/libMLIRPtrMemorySpaceInterfaces.so.22.0git  lib/libMLIROpenACCMPCommon.so.22.0git  lib/libMLIRMemorySlotInterfaces.so.22.0git  lib/libMLIRMemOpInterfaces.so.22.0git  lib/libMLIRValueBoundsOpInterface.so.22.0git  lib/libMLIRDestinationStyleOpInterface.so.22.0git  lib/libMLIRPass.so.22.0git  lib/libMLIRAnalysis.so.22.0git  lib/libMLIRControlFlowInterfaces.so.22.0git  lib/libMLIRDataLayoutInterfaces.so.22.0git  lib/libMLIRInferStridedMetadataInterface.so.22.0git  lib/libMLIRInferIntRangeInterface.so.22.0git  lib/libMLIRLoopLikeInterface.so.22.0git  lib/libMLIRPresburger.so.22.0git  lib/libMLIRViewLikeInterface.so.22.0git  lib/libMLIRFunctionInterfaces.so.22.0git  lib/libMLIRCallInterfaces.so.22.0git  lib/libMLIRInferTypeOpInterface.so.22.0git  lib/libMLIRSideEffectInterfaces.so.22.0git  lib/libMLIRIR.so.22.0git  lib/libMLIRSupport.so.22.0git  lib/libLLVMCore.so.22.0git  lib/libLLVMBinaryFormat.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib && :
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::getModRef(mlir::Operation*, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE]+0x9): undefined reference to `fir::AliasAnalysis::getModRef(mlir::Operation*, mlir::Value)'
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::alias(mlir::Value, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_]+0x9): undefined reference to `fir::AliasAnalysis::alias(mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[8098/8192] Linking CXX shared library lib/libFIRCodeGen.so.22.0git
[8099/8192] Linking CXX shared library lib/libFlangOpenMPTransforms.so.22.0git
[8100/8192] Linking CXX executable bin/fir-lsp-server
[8101/8192] Building CXX object tools/flang/test/lib/OpenACC/CMakeFiles/FIRTestOpenACCInterfaces.dir/TestOpenACCInterfaces.cpp.o
[8102/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Mangler.cpp.o
[8103/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CodeGenOptions.cpp.o
[8104/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInstance.cpp.o
[8105/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertVariable.cpp.o
[8106/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/IO.cpp.o
[8107/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/HostAssociations.cpp.o
[8108/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExprToHLFIR.cpp.o
[8109/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInvocation.cpp.o
[8110/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Decomposer.cpp.o
[8111/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendAction.cpp.o
[8112/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendOptions.cpp.o
[8113/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Atomic.cpp.o
[8114/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/TextDiagnosticBuffer.cpp.o
[8115/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/TextDiagnosticPrinter.cpp.o
[8116/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/TextDiagnostic.cpp.o
[8117/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Support/Utils.cpp.o
[8118/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o
[8119/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o
[8120/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o
[8121/8192] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-omp-atomic.cpp.o
[8122/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o
[8123/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/ClauseProcessor.cpp.o
[8124/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendActions.cpp.o
[8125/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Clauses.cpp.o
[8126/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o
[8127/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o
[8128/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/ParserActions.cpp.o
ninja: build stopped: subcommand failed.
Step 7 (build cmake config) failure: build cmake config (failure)
...
[8088/8192] Creating library symlink lib/libFIROpenMPSupport.so
[8089/8192] Linking CXX shared library lib/libFortranUtils.so.22.0git
[8090/8192] Creating library symlink lib/libFortranUtils.so
[8091/8192] Linking CXX shared library lib/libFIROpenACCSupport.so.22.0git
[8092/8192] Creating library symlink lib/libFIROpenACCSupport.so
[8093/8192] Linking CXX shared library lib/libFIRAnalysis.so.22.0git
[8094/8192] Creating library symlink lib/libFIRAnalysis.so
[8095/8192] Linking CXX shared library lib/libFIROpenACCAnalysis.so.22.0git
[8096/8192] Creating library symlink lib/libFIROpenACCAnalysis.so
[8097/8192] Linking CXX shared library lib/libFIROpenACCTransforms.so.22.0git
FAILED: lib/libFIROpenACCTransforms.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libFIROpenACCTransforms.so.22.0git -o lib/libFIROpenACCTransforms.so.22.0git tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCRecipeBufferization.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib:"  lib/libFIROpenACCAnalysis.so.22.0git  lib/libHLFIRDialect.so.22.0git  lib/libFIRDialect.so.22.0git  lib/libMLIROpenACCDialect.so.22.0git  lib/libMLIRMemRefDialect.so.22.0git  lib/libMLIRArithUtils.so.22.0git  lib/libMLIRComplexDialect.so.22.0git  lib/libMLIRDialectUtils.so.22.0git  lib/libMLIRArithDialect.so.22.0git  lib/libMLIRInferIntRangeCommon.so.22.0git  lib/libMLIRShapedOpInterfaces.so.22.0git  lib/libMLIRCastInterfaces.so.22.0git  lib/libMLIRDialect.so.22.0git  lib/libMLIRUBDialect.so.22.0git  lib/libMLIRLLVMDialect.so.22.0git  lib/libMLIRPtrMemorySpaceInterfaces.so.22.0git  lib/libMLIROpenACCMPCommon.so.22.0git  lib/libMLIRMemorySlotInterfaces.so.22.0git  lib/libMLIRMemOpInterfaces.so.22.0git  lib/libMLIRValueBoundsOpInterface.so.22.0git  lib/libMLIRDestinationStyleOpInterface.so.22.0git  lib/libMLIRPass.so.22.0git  lib/libMLIRAnalysis.so.22.0git  lib/libMLIRControlFlowInterfaces.so.22.0git  lib/libMLIRDataLayoutInterfaces.so.22.0git  lib/libMLIRInferStridedMetadataInterface.so.22.0git  lib/libMLIRInferIntRangeInterface.so.22.0git  lib/libMLIRLoopLikeInterface.so.22.0git  lib/libMLIRPresburger.so.22.0git  lib/libMLIRViewLikeInterface.so.22.0git  lib/libMLIRFunctionInterfaces.so.22.0git  lib/libMLIRCallInterfaces.so.22.0git  lib/libMLIRInferTypeOpInterface.so.22.0git  lib/libMLIRSideEffectInterfaces.so.22.0git  lib/libMLIRIR.so.22.0git  lib/libMLIRSupport.so.22.0git  lib/libLLVMCore.so.22.0git  lib/libLLVMBinaryFormat.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib && :
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::getModRef(mlir::Operation*, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE]+0x9): undefined reference to `fir::AliasAnalysis::getModRef(mlir::Operation*, mlir::Value)'
/usr/bin/ld: tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: in function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::alias(mlir::Value, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_]+0x9): undefined reference to `fir::AliasAnalysis::alias(mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[8098/8192] Linking CXX shared library lib/libFIRCodeGen.so.22.0git
[8099/8192] Linking CXX shared library lib/libFlangOpenMPTransforms.so.22.0git
[8100/8192] Linking CXX executable bin/fir-lsp-server
[8101/8192] Building CXX object tools/flang/test/lib/OpenACC/CMakeFiles/FIRTestOpenACCInterfaces.dir/TestOpenACCInterfaces.cpp.o
[8102/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Mangler.cpp.o
[8103/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CodeGenOptions.cpp.o
[8104/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInstance.cpp.o
[8105/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertVariable.cpp.o
[8106/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/IO.cpp.o
[8107/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/HostAssociations.cpp.o
[8108/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExprToHLFIR.cpp.o
[8109/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInvocation.cpp.o
[8110/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Decomposer.cpp.o
[8111/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendAction.cpp.o
[8112/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendOptions.cpp.o
[8113/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Atomic.cpp.o
[8114/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/TextDiagnosticBuffer.cpp.o
[8115/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/TextDiagnosticPrinter.cpp.o
[8116/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/TextDiagnostic.cpp.o
[8117/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Support/Utils.cpp.o
[8118/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o
[8119/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o
[8120/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o
[8121/8192] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-omp-atomic.cpp.o
[8122/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o
[8123/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/ClauseProcessor.cpp.o
[8124/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendActions.cpp.o
[8125/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Clauses.cpp.o
[8126/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o
[8127/8192] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o
[8128/8192] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/ParserActions.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 7, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-8-cmake-build-only running on rocm-docker-rhel-8 while building flang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/27202

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[8118/8192] Creating library symlink lib/libFIROpenACCSupport.so
[8119/8192] Linking CXX shared library lib/libFIRAnalysis.so.22.0git
[8120/8192] Creating library symlink lib/libFIRAnalysis.so
[8121/8192] Linking CXX shared library lib/libFortranUtils.so.22.0git
[8122/8192] Creating library symlink lib/libFortranUtils.so
[8123/8192] Linking CXX shared library lib/libFIRTestOpenACCInterfaces.so.22.0git
[8124/8192] Linking CXX shared library lib/libFIROpenACCAnalysis.so.22.0git
[8125/8192] Creating library symlink lib/libFIRTestOpenACCInterfaces.so
[8126/8192] Creating library symlink lib/libFIROpenACCAnalysis.so
[8127/8192] Linking CXX shared library lib/libFIROpenACCTransforms.so.22.0git
FAILED: lib/libFIROpenACCTransforms.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-array-bounds -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libFIROpenACCTransforms.so.22.0git -o lib/libFIROpenACCTransforms.so.22.0git tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCRecipeBufferization.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib:"  lib/libFIROpenACCAnalysis.so.22.0git  lib/libHLFIRDialect.so.22.0git  lib/libFIRDialect.so.22.0git  lib/libMLIROpenACCDialect.so.22.0git  lib/libMLIRMemRefDialect.so.22.0git  lib/libMLIRArithUtils.so.22.0git  lib/libMLIRComplexDialect.so.22.0git  lib/libMLIRDialectUtils.so.22.0git  lib/libMLIRArithDialect.so.22.0git  lib/libMLIRInferIntRangeCommon.so.22.0git  lib/libMLIRShapedOpInterfaces.so.22.0git  lib/libMLIRCastInterfaces.so.22.0git  lib/libMLIRDialect.so.22.0git  lib/libMLIRUBDialect.so.22.0git  lib/libMLIRLLVMDialect.so.22.0git  lib/libMLIRPtrMemorySpaceInterfaces.so.22.0git  lib/libMLIROpenACCMPCommon.so.22.0git  lib/libMLIRMemorySlotInterfaces.so.22.0git  lib/libMLIRMemOpInterfaces.so.22.0git  lib/libMLIRValueBoundsOpInterface.so.22.0git  lib/libMLIRDestinationStyleOpInterface.so.22.0git  lib/libMLIRPass.so.22.0git  lib/libMLIRAnalysis.so.22.0git  lib/libMLIRControlFlowInterfaces.so.22.0git  lib/libMLIRDataLayoutInterfaces.so.22.0git  lib/libMLIRInferStridedMetadataInterface.so.22.0git  lib/libMLIRInferIntRangeInterface.so.22.0git  lib/libMLIRLoopLikeInterface.so.22.0git  lib/libMLIRPresburger.so.22.0git  lib/libMLIRViewLikeInterface.so.22.0git  lib/libMLIRFunctionInterfaces.so.22.0git  lib/libMLIRCallInterfaces.so.22.0git  lib/libMLIRInferTypeOpInterface.so.22.0git  lib/libMLIRSideEffectInterfaces.so.22.0git  lib/libMLIRIR.so.22.0git  lib/libMLIRSupport.so.22.0git  -lpthread  lib/libLLVMCore.so.22.0git  lib/libLLVMBinaryFormat.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib && :
tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: In function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::getModRef(mlir::Operation*, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE]+0x5): undefined reference to `fir::AliasAnalysis::getModRef(mlir::Operation*, mlir::Value)'
tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: In function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::alias(mlir::Value, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_]+0x5): undefined reference to `fir::AliasAnalysis::alias(mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[8128/8192] Linking CXX shared library lib/libFIRCodeGen.so.22.0git
[8129/8192] Linking CXX shared library lib/libFlangOpenMPTransforms.so.22.0git
[8130/8192] Linking CXX executable bin/fir-lsp-server
[8131/8192] Linking CXX shared library lib/libFortranSemantics.so.22.0git
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 62, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 53, in main
    run_command(["ninja"])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 75, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
Step 7 (build cmake config) failure: build cmake config (failure)
...
[8118/8192] Creating library symlink lib/libFIROpenACCSupport.so
[8119/8192] Linking CXX shared library lib/libFIRAnalysis.so.22.0git
[8120/8192] Creating library symlink lib/libFIRAnalysis.so
[8121/8192] Linking CXX shared library lib/libFortranUtils.so.22.0git
[8122/8192] Creating library symlink lib/libFortranUtils.so
[8123/8192] Linking CXX shared library lib/libFIRTestOpenACCInterfaces.so.22.0git
[8124/8192] Linking CXX shared library lib/libFIROpenACCAnalysis.so.22.0git
[8125/8192] Creating library symlink lib/libFIRTestOpenACCInterfaces.so
[8126/8192] Creating library symlink lib/libFIROpenACCAnalysis.so
[8127/8192] Linking CXX shared library lib/libFIROpenACCTransforms.so.22.0git
FAILED: lib/libFIROpenACCTransforms.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-array-bounds -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libFIROpenACCTransforms.so.22.0git -o lib/libFIROpenACCTransforms.so.22.0git tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCRecipeBufferization.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib:"  lib/libFIROpenACCAnalysis.so.22.0git  lib/libHLFIRDialect.so.22.0git  lib/libFIRDialect.so.22.0git  lib/libMLIROpenACCDialect.so.22.0git  lib/libMLIRMemRefDialect.so.22.0git  lib/libMLIRArithUtils.so.22.0git  lib/libMLIRComplexDialect.so.22.0git  lib/libMLIRDialectUtils.so.22.0git  lib/libMLIRArithDialect.so.22.0git  lib/libMLIRInferIntRangeCommon.so.22.0git  lib/libMLIRShapedOpInterfaces.so.22.0git  lib/libMLIRCastInterfaces.so.22.0git  lib/libMLIRDialect.so.22.0git  lib/libMLIRUBDialect.so.22.0git  lib/libMLIRLLVMDialect.so.22.0git  lib/libMLIRPtrMemorySpaceInterfaces.so.22.0git  lib/libMLIROpenACCMPCommon.so.22.0git  lib/libMLIRMemorySlotInterfaces.so.22.0git  lib/libMLIRMemOpInterfaces.so.22.0git  lib/libMLIRValueBoundsOpInterface.so.22.0git  lib/libMLIRDestinationStyleOpInterface.so.22.0git  lib/libMLIRPass.so.22.0git  lib/libMLIRAnalysis.so.22.0git  lib/libMLIRControlFlowInterfaces.so.22.0git  lib/libMLIRDataLayoutInterfaces.so.22.0git  lib/libMLIRInferStridedMetadataInterface.so.22.0git  lib/libMLIRInferIntRangeInterface.so.22.0git  lib/libMLIRLoopLikeInterface.so.22.0git  lib/libMLIRPresburger.so.22.0git  lib/libMLIRViewLikeInterface.so.22.0git  lib/libMLIRFunctionInterfaces.so.22.0git  lib/libMLIRCallInterfaces.so.22.0git  lib/libMLIRInferTypeOpInterface.so.22.0git  lib/libMLIRSideEffectInterfaces.so.22.0git  lib/libMLIRIR.so.22.0git  lib/libMLIRSupport.so.22.0git  -lpthread  lib/libLLVMCore.so.22.0git  lib/libLLVMBinaryFormat.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib && :
tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: In function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::getModRef(mlir::Operation*, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE9getModRefEPNS_9OperationENS_5ValueE]+0x5): undefined reference to `fir::AliasAnalysis::getModRef(mlir::Operation*, mlir::Value)'
tools/flang/lib/Optimizer/OpenACC/Transforms/CMakeFiles/FIROpenACCTransforms.dir/ACCInitializeFIRAnalyses.cpp.o: In function `mlir::detail::AliasAnalysisTraits::Model<fir::AliasAnalysis>::alias(mlir::Value, mlir::Value)':
ACCInitializeFIRAnalyses.cpp:(.text._ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_[_ZN4mlir6detail19AliasAnalysisTraits5ModelIN3fir13AliasAnalysisEE5aliasENS_5ValueES6_]+0x5): undefined reference to `fir::AliasAnalysis::alias(mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[8128/8192] Linking CXX shared library lib/libFIRCodeGen.so.22.0git
[8129/8192] Linking CXX shared library lib/libFlangOpenMPTransforms.so.22.0git
[8130/8192] Linking CXX executable bin/fir-lsp-server
[8131/8192] Linking CXX shared library lib/libFortranSemantics.so.22.0git
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 62, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 53, in main
    run_command(["ninja"])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 75, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
program finished with exit code 0
elapsedTime=442.729001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:fir-hlfir flang Flang issues not falling into any other category openacc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants