[flang-commits] [flang] 99794e2 - [flang] Fix flang-aarch64-latest-gcc build failure

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Tue Jun 13 20:22:11 PDT 2023


Author: Kelvin Li
Date: 2023-06-13T23:17:59-04:00
New Revision: 99794e2239acdd33f1565a93fbe49b3b75945f3b

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

LOG: [flang] Fix flang-aarch64-latest-gcc build failure

The failure is due to mismatch of the SmallVector parameter and the
return when built by gcc.

Added: 
    

Modified: 
    flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index f595bbeac1935..fe34a3c6976b4 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -125,7 +125,7 @@ struct VecTypeInfo {
   bool isFloat() { return isFloat32() || isFloat64(); }
 };
 
-static llvm::SmallVector<mlir::Value>
+static llvm::SmallVector<mlir::Value, 4>
 getBasesForArgs(llvm::ArrayRef<fir::ExtendedValue> args) {
   llvm::SmallVector<mlir::Value, 4> baseVec;
   for (auto arg : args)
@@ -133,7 +133,7 @@ getBasesForArgs(llvm::ArrayRef<fir::ExtendedValue> args) {
   return baseVec;
 }
 
-static llvm::SmallVector<mlir::Type>
+static llvm::SmallVector<mlir::Type, 4>
 getTypesForArgs(llvm::ArrayRef<mlir::Value> args) {
   llvm::SmallVector<mlir::Type, 4> typeVec;
   for (auto arg : args)
@@ -156,9 +156,9 @@ static VecTypeInfo getVecTypeFromFir(mlir::Value firVec) {
 }
 
 // Converts array of fir vectors to mlir vectors.
-static llvm::SmallVector<mlir::Value>
+static llvm::SmallVector<mlir::Value, 4>
 convertVecArgs(fir::FirOpBuilder &builder, mlir::Location loc,
-               VecTypeInfo vecTyInfo, llvm::SmallVector<mlir::Value> args) {
+               VecTypeInfo vecTyInfo, llvm::SmallVector<mlir::Value, 4> args) {
   llvm::SmallVector<mlir::Value, 4> newArgs;
   auto ty{vecTyInfo.toMlirVectorType(builder.getContext())};
   assert(ty && "unknown mlir vector type");


        


More information about the flang-commits mailing list